-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: migrate to eslint v9 * chore: update github action * fix: irregular whitespace * fix: unsafe optional chaining * fix: prefer const * fix: no case declaration * fix: no useless escape * fix: unnecessary rule * fix: no var * fix: no empty object type * fix: no wrapper object type * fix no unused expressions rule * fix: prefer rest params * fix: remove extra line
- Loading branch information
Showing
145 changed files
with
686 additions
and
579 deletions.
There are no files selected for viewing
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
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,104 @@ | ||
import { fixupPluginRules } from '@eslint/compat' | ||
import pluginJs from '@eslint/js' | ||
import pluginImport from 'eslint-plugin-import' | ||
import pluginJsxA11y from 'eslint-plugin-jsx-a11y' | ||
import pluginPrettier from 'eslint-plugin-prettier/recommended' | ||
import pluginReact from 'eslint-plugin-react' | ||
import pluginReactHooks from 'eslint-plugin-react-hooks' | ||
import pluginTailwind from 'eslint-plugin-tailwindcss' | ||
import globals from 'globals' | ||
import pluginTypescriptEslint from 'typescript-eslint' | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
{ | ||
ignores: [ | ||
'**/dist/*', | ||
'.github/**/*', | ||
'**/globals.d.ts', | ||
'**/generated/**/*', | ||
'cypress/**/*', | ||
'src/lago-expression/*', | ||
], | ||
}, | ||
|
||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
...globals.jest, | ||
}, | ||
sourceType: 'module', | ||
}, | ||
}, | ||
|
||
pluginJs.configs.recommended, | ||
...pluginTypescriptEslint.configs.recommended, | ||
pluginReact.configs.flat.recommended, | ||
pluginReact.configs.flat['jsx-runtime'], | ||
...pluginTailwind.configs['flat/recommended'], | ||
|
||
{ | ||
files: ['**/*.{js,mjs,cjs,ts,mts,jsx,tsx}'], | ||
plugins: { | ||
import: fixupPluginRules(pluginImport), | ||
'jsx-a11y': pluginJsxA11y, | ||
'react-hooks': pluginReactHooks, | ||
}, | ||
languageOptions: { | ||
parser: pluginTypescriptEslint.parser, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
ecmaVersion: 6, | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
...pluginJsxA11y.configs.recommended.rules, | ||
...pluginReactHooks.configs.recommended.rules, | ||
|
||
'no-alert': 'error', | ||
'no-console': 'error', | ||
eqeqeq: 'error', | ||
'no-else-return': 'warn', | ||
'no-unused-vars': 'off', | ||
'newline-after-var': ['warn'], // TOFIX: Deprecated rule | ||
'no-extra-boolean-cast': 'off', | ||
|
||
// Plugins | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: ['builtin', 'external', 'internal', 'unknown', 'sibling', 'parent', 'index'], | ||
'newlines-between': 'always', | ||
}, | ||
], | ||
'@typescript-eslint/no-non-null-assertion': 'error', | ||
// https://typescript-eslint.io/rules/no-shadow/ | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': 'error', | ||
// https://typescript-eslint.io/rules/no-unused-expressions/ | ||
'no-unused-expressions': 'off', | ||
'@typescript-eslint/no-unused-expressions': [ | ||
'error', | ||
{ | ||
allowTernary: true, | ||
allowShortCircuit: true, | ||
allowTaggedTemplates: true, | ||
}, | ||
], | ||
'@typescript-eslint/no-unsafe-function-type': 'warn', | ||
'@typescript-eslint/ban-ts-comment': 'warn', | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.js'], | ||
rules: { | ||
'@typescript-eslint/no-require-imports': 'off', | ||
}, | ||
}, | ||
pluginPrettier, | ||
] |
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
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
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.