-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trivial - add linting to playground (#1426)
* add basic linting to playground * lint testapp as part of ci
- Loading branch information
1 parent
1bd8d67
commit d06584e
Showing
9 changed files
with
249 additions
and
182 deletions.
There are no files selected for viewing
This file contains 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 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,87 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'preact', | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
settings: { | ||
react: { | ||
pragma: 'h', | ||
}, | ||
}, | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
commonjs: true, | ||
}, | ||
plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports', 'prettier'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'simple-import-sort/imports': [ | ||
'error', | ||
{ | ||
groups: [['^\\u0000'], ['^@?\\w'], ['^src(/.*|$)']], | ||
}, | ||
], | ||
'simple-import-sort/exports': 'error', | ||
'no-unused-vars': 'off', | ||
'unused-imports/no-unused-imports': 'error', | ||
'unused-imports/no-unused-vars': [ | ||
'error', | ||
{ | ||
vars: 'all', | ||
varsIgnorePattern: '^_', | ||
args: 'after-used', | ||
argsIgnorePattern: '^_', | ||
}, | ||
], | ||
'no-console': [ | ||
'error', | ||
{ | ||
allow: ['warn', 'error', 'info'], | ||
}, | ||
], | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
arrowParens: 'always', | ||
bracketSpacing: true, | ||
endOfLine: 'lf', | ||
htmlWhitespaceSensitivity: 'css', | ||
printWidth: 100, | ||
quoteProps: 'as-needed', | ||
semi: true, | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'es5', | ||
useTabs: false, | ||
}, | ||
], | ||
// TODO: change this back to error | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'no-useless-constructor': 'off', | ||
'no-restricted-globals': [ | ||
'error', | ||
{ | ||
name: 'parseInt', | ||
message: 'Use Number.parseInt instead of parseInt.', | ||
}, | ||
], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/*.test.*'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
This file contains 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 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 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 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 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.