Skip to content

lint: fix most eslint issues#9017

Merged
NathanWalker merged 4 commits into
NativeScript:masterfrom
Akylas:eslint
Nov 11, 2020
Merged

lint: fix most eslint issues#9017
NathanWalker merged 4 commits into
NativeScript:masterfrom
Akylas:eslint

Conversation

@farfromrefug
Copy link
Copy Markdown
Collaborator

This PR fixes most eslint issues. For some it adds a TODO because the why is not clear.
This is really important in the sense that it makes working with eslint/vscode much smoother.
Before this i was flooded with warning and errors (more that 3000).

@cla-bot cla-bot Bot added the cla: yes label Nov 8, 2020
@NathanWalker
Copy link
Copy Markdown
Contributor

Is this up to date with master @farfromrefug ?
If it is, looks like the changes here introduce some issues with the unit tests that are not present on master:

> nx run core:unit 
../../../node_modules/@types/node/globals.d.ts:42:13 - error TS2451: Cannot redeclare block-scoped variable '__filename'.
42 declare var __filename: string;
               ~~~~~~~~~~
  ../global-types.d.ts:227:13
    227 declare let __filename: string;
                    ~~~~~~~~~~
    '__filename' was also declared here.
../../../node_modules/@types/node/globals.d.ts:43:13 - error TS2451: Cannot redeclare block-scoped variable '__dirname'.
43 declare var __dirname: string;
               ~~~~~~~~~
  ../global-types.d.ts:226:13
    226 declare let __dirname: string;
                    ~~~~~~~~~
    '__dirname' was also declared here.
../../../node_modules/@types/node/globals.d.ts:62:13 - error TS2451: Cannot redeclare block-scoped variable 'require'.
62 declare var require: NodeRequire;
               ~~~~~~~
  ../global-types.d.ts:212:13
    212 declare let require: NodeRequire;
                    ~~~~~~~
    'require' was also declared here.
../../../node_modules/@types/node/globals.d.ts:63:13 - error TS2451: Cannot redeclare block-scoped variable 'module'.
63 declare var module: NodeModule;
               ~~~~~~
  ../global-types.d.ts:229:13
    229 declare let module: NodeModule;
                    ~~~~~~
    'module' was also declared here.
../../../node_modules/@types/node/globals.d.ts:66:13 - error TS2451: Cannot redeclare block-scoped variable 'exports'.
66 declare var exports: any;
               ~~~~~~~
  ../global-types.d.ts:231:13
    231 declare let exports: any;
                    ~~~~~~~
    'exports' was also declared here.
../../../node_modules/@types/node/ts3.5/globals.global.d.ts:1:13 - error TS2451: Cannot redeclare block-scoped variable 'global'.
1 declare var global: NodeJS.Global & typeof globalThis;
              ~~~~~~
  ../global-types.d.ts:1:13
    1 declare let global: NodeJS.Global & typeof globalThis;
                  ~~~~~~
    'global' was also declared here.
../global-types.d.ts:1:13 - error TS2451: Cannot redeclare block-scoped variable 'global'.
1 declare let global: NodeJS.Global & typeof globalThis;
              ~~~~~~
  ../../../node_modules/@types/node/ts3.5/globals.global.d.ts:1:13
    1 declare var global: NodeJS.Global & typeof globalThis;
                  ~~~~~~
    'global' was also declared here.
../global-types.d.ts:212:13 - error TS2451: Cannot redeclare block-scoped variable 'require'.
212 declare let require: NodeRequire;
                ~~~~~~~
  ../../../node_modules/@types/node/globals.d.ts:62:13
    62 declare var require: NodeRequire;
                   ~~~~~~~
    'require' was also declared here.
../global-types.d.ts:226:13 - error TS2451: Cannot redeclare block-scoped variable '__dirname'.
226 declare let __dirname: string;
                ~~~~~~~~~
  ../../../node_modules/@types/node/globals.d.ts:43:13
    43 declare var __dirname: string;
                   ~~~~~~~~~
    '__dirname' was also declared here.
../global-types.d.ts:227:13 - error TS2451: Cannot redeclare block-scoped variable '__filename'.
227 declare let __filename: string;
                ~~~~~~~~~~
  ../../../node_modules/@types/node/globals.d.ts:42:13
    42 declare var __filename: string;
                   ~~~~~~~~~~
    '__filename' was also declared here.
../global-types.d.ts:229:13 - error TS2451: Cannot redeclare block-scoped variable 'module'.
229 declare let module: NodeModule;
                ~~~~~~
  ../../../node_modules/@types/node/globals.d.ts:63:13
    63 declare var module: NodeModule;
                   ~~~~~~
    'module' was also declared here.
../global-types.d.ts:231:13 - error TS2451: Cannot redeclare block-scoped variable 'exports'.
231 declare let exports: any;
                ~~~~~~~
  ../../../node_modules/@types/node/globals.d.ts:66:13
    66 declare var exports: any;
                   ~~~~~~~
    'exports' was also declared here.
Found 12 errors.

Copy link
Copy Markdown
Contributor

@NathanWalker NathanWalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes cause unit test run failures.

@NathanWalker
Copy link
Copy Markdown
Contributor

Thanks @farfromrefug when possible to just rebase in master to contain your recently merged pr around the color parsing we can get this merged 💯

…lint

# Conflicts:
#	packages/core/css/parser.ts
@farfromrefug
Copy link
Copy Markdown
Collaborator Author

@NathanWalker done

@NathanWalker NathanWalker merged commit c1f231d into NativeScript:master Nov 11, 2020
@CatchABus
Copy link
Copy Markdown
Contributor

@farfromrefug I know this has been merged but there are few errors when running automated app.
For start, reverting the following 2 lines helped application build successfully:
https://github.com/NativeScript/NativeScript/blob/master/packages/core/ui/builder/binding-builder.ts#L2
https://github.com/NativeScript/NativeScript/blob/master/packages/core/utils/utils-common.ts#L14

@farfromrefug
Copy link
Copy Markdown
Collaborator Author

Damn I wasn't so sure about those regexp. Will revert them all later tonight

@farfromrefug
Copy link
Copy Markdown
Collaborator Author

@dimitrisrk @NathanWalker here is the fix #9028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants