-
Notifications
You must be signed in to change notification settings - Fork 171
Linting fixes (main process & scripts) #1346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
57035fc
non-package changes
e760a1a
use build tsconfig
ae16f11
update
6590ea3
add linting config
b29cad0
update config, add missing packages
48885a6
rework
b5a62ba
update conf
6c6b8f8
remove jsx-a11y script
06f29fd
move to flat config
407b42d
remove eslint-plugin-import
545e68e
standardise config import
f7b77c1
add comments
29e7e19
update package
24d1201
add linting config
0f9738a
update config, add missing packages
3a50e95
update conf
7a96daa
remove jsx-a11y script
4f2a37e
delete unused
23e405d
update scripts
b339d95
autofixes
9fbcfb8
test fixes
f14cbd3
scripts fixes
24eedbf
fix resources
d4b28ff
add resources/Native to JSX
3dbedae
add ts rest exemption for no-unused-vars
e4bd074
put crypt back
4723bec
add ignore dirs
6ed5a5f
exempt no-empty-function
7179d15
delete unused
6ab8ce4
fix main low-hanging fruit
236bf2d
exempt signers
a2764ec
use ES module declaration style instead of namespace
652b1ed
fix
4834929
fix types
a4d90c2
remove old eslint comments
f38083a
disable unused vars
ce911e8
fix entry points
06a0679
standardise config, update comments
923717d
add types for deep-equal
c51ad09
revert signers changes
d27a2ee
update package
8da3138
fix rebase
e580e3b
fixy
e617365
add deep-equal types
9552a2c
fix tests
1a593c0
fix colorway exemption
1a77e64
move renderer conf
be9c87f
address PR comments
4540efc
use es2021, add globals
a8bdc8e
remove globals comments
1a78a1f
comment out unused
4048feb
update noop rule
96be519
update ur lock
goosewobbler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| { | ||
| "**/*.{yml,json,md,html,ts,js}": "prettier --check" | ||
| "**/*.{yml,json,md,html,ts,js}": "prettier --check", | ||
| "**/*.{ts,tsx,js,jsx}": "eslint --quiet --fix" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| /* globals self */ | ||
|
|
||
| let canvas, ctx, looper | ||
| const particles = [] | ||
| const particleCount = 56 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| /* globals */ | ||
|
|
||
| import EventEmitter from 'events' | ||
| import Restore from 'react-restore' | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| /* globals ResizeObserver */ | ||
|
|
||
| import React from 'react' | ||
| import Restore from 'react-restore' | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| import ts from '@typescript-eslint/eslint-plugin' | ||
| import tsParser from '@typescript-eslint/parser' | ||
| import prettier from 'eslint-config-prettier' | ||
| import react from 'eslint-plugin-react' | ||
| import reactHooks from 'eslint-plugin-react-hooks' | ||
| import testingLibrary from 'eslint-plugin-testing-library' | ||
| import jest from 'eslint-plugin-jest' | ||
| import globals from 'globals' | ||
|
|
||
| export default [ | ||
| 'eslint:recommended', | ||
| // Ignored dirs | ||
| { | ||
| ignores: ['dist/**/*', 'compiled/**/*', 'bundle/**/*'] | ||
| }, | ||
| // Temporary ignored dirs - TODO: remove on rewrite | ||
| { | ||
| ignores: ['main/signers/**/*'] | ||
| }, | ||
| // All files | ||
| { | ||
| files: ['**/*.{js,mjs,ts,tsx}'], | ||
| languageOptions: { | ||
| ecmaVersion: 'latest', | ||
| globals: { | ||
| ...globals.es2021 | ||
| } | ||
| }, | ||
| rules: { | ||
| ...prettier.rules, | ||
| 'no-unused-vars': [ | ||
| 'error', | ||
| { | ||
| args: 'after-used', | ||
| ignoreRestSiblings: true, | ||
| argsIgnorePattern: '^_', | ||
| destructuredArrayIgnorePattern: '^_' | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| // Main process files and scripts | ||
| { | ||
| files: ['**/*.{js,mjs,ts}'], | ||
| ignores: ['app/**/*', 'resources/Components/**/*'], | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.node | ||
| } | ||
| } | ||
| }, | ||
| // Renderer process files | ||
| { | ||
| files: [ | ||
| 'app/**/*.js', | ||
| 'main/dapps/server/inject/*.js', | ||
| 'resources/**/*.{js,ts,tsx}', | ||
| 'test/app/**/*.js', | ||
| 'test/resources/Components/**/*.js' | ||
| ], | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.browser, | ||
| process: true, | ||
| global: true | ||
| } | ||
| } | ||
| }, | ||
| // TS files | ||
| { | ||
| files: ['**/*.{ts,tsx}'], | ||
| languageOptions: { | ||
| parser: tsParser, | ||
| parserOptions: { | ||
| ecmaFeatures: { modules: true }, | ||
| ecmaVersion: 'latest', | ||
| project: './tsconfig.json' | ||
| } | ||
| }, | ||
| plugins: { | ||
| '@typescript-eslint': ts | ||
| }, | ||
| rules: { | ||
| ...ts.configs['eslint-recommended'].rules, | ||
| ...ts.configs.recommended.rules, | ||
| 'no-undef': 'off', // redundant - TS will fail to compile with undefined vars | ||
| '@typescript-eslint/no-unused-vars': [ | ||
| 'error', | ||
| { | ||
| args: 'after-used', | ||
| ignoreRestSiblings: true, | ||
| argsIgnorePattern: '^_', | ||
| destructuredArrayIgnorePattern: '^_' | ||
| } | ||
| ], | ||
| '@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }], // allow noop arrow functions, e.g. in a method signature for ensuring a parameter defaults to a function | ||
| '@typescript-eslint/prefer-namespace-keyword': 'off', // use ES module syntax instead of namespace | ||
| '@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }] | ||
| } | ||
| }, | ||
| // React / JSX files | ||
| // TODO: simplify as '**/*.{jsx,tsx}' | ||
| { | ||
| files: [ | ||
| 'app/**/*.js', | ||
| 'resources/Components/**/*.js', | ||
| 'resources/Native/**/*.js', | ||
| 'resources/svg/index.js', | ||
| 'test/app/**/*.js', | ||
| 'test/resources/Components/**/*.js', | ||
| 'test/jest.svg.js' | ||
| ], | ||
| plugins: { | ||
| react, | ||
| 'react-hooks': reactHooks | ||
| }, | ||
| languageOptions: { | ||
| parserOptions: { | ||
| ecmaFeatures: { | ||
| jsx: true | ||
| } | ||
| } | ||
| }, | ||
| settings: { | ||
| react: { | ||
| version: 'detect' | ||
| } | ||
| }, | ||
| rules: { | ||
| ...react.configs.recommended.rules, | ||
| ...react.configs['jsx-runtime'].rules, | ||
| ...reactHooks.configs.recommended.rules, | ||
| 'react/prop-types': 'off' // all type checking to be done in TS | ||
| } | ||
| }, | ||
| // Test files | ||
| { | ||
| files: ['test/**/*.js', '**/__mocks__/**/*.js'], | ||
| plugins: { | ||
| jest | ||
| }, | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.jest | ||
| } | ||
| } | ||
| // TODO: enable jest rules | ||
| // rules: { | ||
| // ...jest.configs.recommended.rules | ||
| // } | ||
| }, | ||
| // Components test files | ||
| { | ||
| files: ['test/app/**/*.js', 'test/resources/Components/**/*.js', 'app/**/__mocks__/**/*.js'], | ||
| plugins: { | ||
| 'testing-library': testingLibrary | ||
| }, | ||
| rules: { | ||
| ...testingLibrary.configs.react.rules | ||
| } | ||
| } | ||
| ] | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.