-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from zetkin/231124-use=single-quote
Use Eslint form app.zetkin
- Loading branch information
Showing
19 changed files
with
988 additions
and
410 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [ "*" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./webapp | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
cache: 'yarn' | ||
cache-dependency-path: ./webapp/yarn.lock | ||
- run: yarn | ||
- run: yarn lint |
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,98 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true, | ||
es6: true, | ||
}, | ||
parserOptions: { ecmaVersion: 8 }, // to enable features such as async/await | ||
// We don't want to lint generated files nor node_modules, but we want to lint .prettierrc.json (ignored by default by eslint) | ||
ignorePatterns: ['node_modules/*', '.next/*', '.out/*', '!.prettierrc.json'], | ||
extends: [ | ||
'eslint:recommended', | ||
'next', | ||
'prettier', | ||
], | ||
settings: { react: { version: 'detect' } }, | ||
overrides: [ | ||
// This configuration will apply only to TypeScript files | ||
{ | ||
files: ['**/*.ts', '**/*.tsx', 'src/**/*.js'], | ||
parser: '@typescript-eslint/parser', | ||
env: { | ||
browser: true, | ||
node: true, | ||
es6: true, | ||
}, | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', // TypeScript rules | ||
'plugin:react-hooks/recommended', // React hooks rules | ||
'plugin:jsx-a11y/recommended', // Accessibility rules | ||
], | ||
plugins: ['no-switch-statements'], | ||
rules: { | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-unused-vars': ['error'], | ||
'@typescript-eslint/member-ordering': [ | ||
'error', | ||
{ | ||
default: { memberTypes: 'never', order: 'alphabetically' }, | ||
interfaces: ['signature', 'method', 'constructor', 'field'], | ||
}, | ||
], | ||
curly: 'error', | ||
'jsx-a11y/anchor-is-valid': 'off', | ||
'no-console': 'error', | ||
'no-switch-statements/no-switch': 'error', | ||
'prefer-const': ['error', {}], | ||
'react/jsx-handler-names': [ | ||
'error', | ||
{ | ||
eventHandlerPrefix: 'on', | ||
eventHandlerPropPrefix: 'on', | ||
}, | ||
], | ||
'react/jsx-no-target-blank': 'error', | ||
'react/jsx-sort-props': [ | ||
'error', | ||
{ | ||
ignoreCase: true, | ||
reservedFirst: true, | ||
}, | ||
], | ||
'react/no-danger': 'error', | ||
'react/no-deprecated': 'error', | ||
'react/no-typos': 'error', | ||
'react/no-unknown-property': 'error', | ||
'react/no-unsafe': [ | ||
'error', | ||
{ | ||
checkAliases: true, | ||
}, | ||
], | ||
'react/no-unused-prop-types': 'error', | ||
'react/prefer-stateless-function': 'error', | ||
'react/prop-types': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
'react-hooks/exhaustive-deps': 'off', | ||
'react/self-closing-comp': [ | ||
'error', | ||
{ | ||
component: true, | ||
html: true, | ||
}, | ||
], | ||
'sort-imports': [ | ||
'error', | ||
{ | ||
ignoreCase: true, | ||
allowSeparatedGroups: true, | ||
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'], | ||
}, | ||
], | ||
'sort-keys': 'error', | ||
'sort-vars': 'error', | ||
}, | ||
}, | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# auto-generated localizations | ||
src/locale/**/*.yml | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
.nyc_output | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build |
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
{ | ||
"singleQuote": true | ||
} |
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.