-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,674 additions
and
270 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
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,97 @@ | ||
import js from '@eslint/js' | ||
import sort from 'eslint-plugin-sort' | ||
import babelParser from '@babel/eslint-parser' | ||
import globals from 'globals' | ||
import widen from 'eslint-plugin-widen' | ||
|
||
export default [ | ||
{ | ||
languageOptions: { | ||
parser: babelParser, | ||
parserOptions: { | ||
requireConfigFile: false, | ||
}, | ||
globals: { | ||
...globals.browser, | ||
...globals.es6, | ||
...globals.jest, | ||
...globals.node, | ||
}, | ||
}, | ||
plugins: { | ||
widen, | ||
sort, | ||
}, | ||
rules: { | ||
'default-param-last': 'error', | ||
'dot-notation': 'error', | ||
eqeqeq: [ | ||
'error', | ||
'always', | ||
{ | ||
null: 'ignore', | ||
}, | ||
], | ||
'no-console': ['error', { allow: ['error'] }], | ||
'no-dupe-args': 'error', | ||
'no-duplicate-imports': 'error', | ||
'no-else-return': 'error', | ||
'no-empty': ['error', { allowEmptyCatch: true }], | ||
'no-extra-bind': 'error', | ||
'no-param-reassign': 'error', | ||
'no-return-await': 'error', | ||
'no-template-curly-in-string': 'error', | ||
'no-unneeded-ternary': 'error', | ||
'no-unused-expressions': 'off', | ||
'no-unused-vars': [ | ||
'error', | ||
{ | ||
ignoreRestSiblings: true, | ||
varsIgnorePattern: '^_', | ||
}, | ||
], | ||
'no-useless-computed-key': 'error', | ||
'no-var': 'error', | ||
'object-shorthand': 'error', | ||
'prefer-const': [ | ||
'error', | ||
{ | ||
destructuring: 'all', | ||
}, | ||
], | ||
'require-await': 'error', | ||
'sort/exports': [ | ||
'warn', | ||
{ | ||
groups: [ | ||
{ order: 6, type: 'default' }, | ||
{ order: 5, type: 'sourceless' }, | ||
{ order: 2, regex: '^@widen\\/' }, | ||
{ order: 4, regex: '^\\.+' }, | ||
{ order: 1, type: 'dependency' }, | ||
{ order: 3, type: 'other' }, | ||
], | ||
}, | ||
], | ||
'sort/imports': [ | ||
'warn', | ||
{ | ||
groups: [ | ||
{ order: 1, type: 'side-effect' }, | ||
{ order: 3, regex: '^@widen\\/' }, | ||
{ order: 5, regex: '^\\.+' }, | ||
{ order: 2, type: 'dependency' }, | ||
{ order: 4, type: 'other' }, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
js.configs.recommended, | ||
{ | ||
files: ['**/*.js', '**/*.mjs'], | ||
rules: { | ||
'prettier/prettier': 'error', // Assuming you have `eslint-plugin-prettier` setup | ||
}, | ||
}, | ||
] |
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,22 @@ | ||
import jest from 'eslint-plugin-jest' | ||
|
||
export default [ | ||
{ | ||
files: [ | ||
'*.spec.js', | ||
'*.test.js', | ||
'*.spec.jsx', | ||
'*.test.jsx', | ||
'*.spec.ts', | ||
'*.test.ts', | ||
'*.spec.tsx', | ||
'*.test.tsx', | ||
], | ||
plugins: { | ||
jest, | ||
}, | ||
rules: { | ||
...jest.configs.recommended.rules, | ||
}, | ||
}, | ||
] |
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,36 @@ | ||
import playwright from 'eslint-plugin-playwright' | ||
|
||
export default [ | ||
{ | ||
plugins: { | ||
playwright, | ||
}, | ||
rules: { | ||
'playwright/missing-playwright-await': [ | ||
'error', | ||
{ customMatchers: ['toBeAccessible', 'toPassAxe'] }, | ||
], | ||
'playwright/no-restricted-matchers': [ | ||
'warn', | ||
{ | ||
toEqualValue: 'Use `toHaveValue` instead.', | ||
toHaveSelector: 'Use `toBeVisible` instead.', | ||
toHaveSelectorCount: 'Use `toHaveCount` instead.', | ||
toMatchAttribute: 'Use `toHaveAttribute` instead.', | ||
toMatchText: 'Use `toHaveText` instead.', | ||
toMatchURL: 'Use `toHaveURL` instead.', | ||
toMatchValue: 'Use `toHaveValue` instead.', | ||
}, | ||
], | ||
'playwright/prefer-lowercase-title': [ | ||
'warn', | ||
{ ignoreTopLevelDescribe: true }, | ||
], | ||
'playwright/prefer-strict-equal': 'warn', | ||
'playwright/prefer-to-be': 'warn', | ||
'playwright/prefer-to-have-length': 'warn', | ||
'playwright/require-top-level-describe': 'warn', | ||
}, | ||
}, | ||
playwright.configs['playwright-test'], | ||
] |
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,71 @@ | ||
import eslintReact from 'eslint-plugin-react' | ||
import eslintReactHooks from 'eslint-plugin-react-hooks' | ||
import eslintJsxA11y from 'eslint-plugin-jsx-a11y' | ||
|
||
export default [ | ||
eslintReact.configs.recommended, | ||
eslintReactHooks.configs.recommended, | ||
eslintJsxA11y.configs.recommended, | ||
{ | ||
files: ['*.tsx', '*.{spec,test}.{js,jsx}'], | ||
rules: { | ||
'react/prop-types': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.{spec,test}.{tsx,js,jsx}'], | ||
rules: { | ||
'react/button-has-type': 'off', | ||
'react/display-name': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.tsx', '*.{spec,test}.{js,jsx}'], | ||
rules: { | ||
'jsx-a11y/click-events-have-key-events': 'warn', | ||
'jsx-a11y/label-has-associated-control': [ | ||
'error', | ||
{ | ||
controlComponents: ['TextInput'], | ||
}, | ||
], | ||
'jsx-a11y/no-autofocus': [ | ||
'warn', | ||
{ | ||
ignoreNonDOM: true, | ||
}, | ||
], | ||
'react/button-has-type': 'warn', | ||
// https://reactjs.org/docs/jsx-in-depth.html#props-default-to-true | ||
'react/jsx-boolean-value': ['warn', 'always'], | ||
'react/jsx-curly-brace-presence': ['warn', 'never'], | ||
'react/jsx-first-prop-new-line': ['error', 'multiline'], | ||
'react/jsx-no-duplicate-props': 'error', | ||
'react/jsx-no-useless-fragment': 'error', | ||
'react/jsx-sort-props': [ | ||
'error', | ||
{ | ||
ignoreCase: true, | ||
reservedFirst: true, | ||
}, | ||
], | ||
'react/no-find-dom-node': 'warn', | ||
'react/no-unescaped-entities': 'off', | ||
'react/no-unknown-property': ['error', { ignore: ['css'] }], | ||
'react/self-closing-comp': 'warn', | ||
'react/sort-prop-types': [ | ||
'error', | ||
{ | ||
ignoreCase: true, | ||
}, | ||
], | ||
'widen/jsx-fragments': 'error', | ||
'widen/jsx-import': 'error', | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
}, | ||
] |
Oops, something went wrong.