This repository has been archived by the owner on Jan 5, 2025. It is now read-only.
-
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
1 parent
b0ab510
commit 377d180
Showing
3 changed files
with
39 additions
and
30 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 |
---|---|---|
@@ -1,72 +1,75 @@ | ||
import js from '@eslint/js' | ||
import tseslint from '@typescript-eslint/eslint-plugin' | ||
import tsparser from '@typescript-eslint/parser' | ||
import reactPlugin from 'eslint-plugin-react' | ||
import reactHooksPlugin from 'eslint-plugin-react-hooks' | ||
import importPlugin from 'eslint-plugin-import' | ||
import prettier from 'eslint-config-prettier' | ||
import js from "@eslint/js"; | ||
import tseslint from "@typescript-eslint/eslint-plugin"; | ||
import tsparser from "@typescript-eslint/parser"; | ||
import reactPlugin from "eslint-plugin-react"; | ||
import reactHooksPlugin from "eslint-plugin-react-hooks"; | ||
import importPlugin from "eslint-plugin-import"; | ||
import prettier from "eslint-config-prettier"; | ||
|
||
export default [ | ||
js.configs.recommended, | ||
|
||
{ | ||
linterOptions: { | ||
reportUnusedDisableDirectives: true, | ||
}, | ||
files: ['**/*.{js,jsx,ts,tsx}'], | ||
files: ["**/*.{js,jsx,ts,tsx}"], | ||
languageOptions: { | ||
parser: tsparser, | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
projectService: true, | ||
}, | ||
}, | ||
plugins: { | ||
'@typescript-eslint': tseslint, | ||
"@typescript-eslint": tseslint, | ||
react: reactPlugin, | ||
'react-hooks': reactHooksPlugin, | ||
"react-hooks": reactHooksPlugin, | ||
import: importPlugin, | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
version: "detect", | ||
}, | ||
'import/resolver': { | ||
"import/resolver": { | ||
typescript: true, | ||
node: true, | ||
}, | ||
}, | ||
rules: { | ||
// TypeScript rules | ||
...tseslint.configs.recommended.rules, | ||
'no-undef': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], | ||
// ...tseslint.configs.recommended.rules, | ||
// tseslint.configs.recommended, | ||
...tseslint.configs["recommended-type-checked"].rules, | ||
"no-undef": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], | ||
|
||
// React rules | ||
...reactPlugin.configs.recommended.rules, | ||
'react/react-in-jsx-scope': 'off', | ||
"react/react-in-jsx-scope": "off", | ||
...reactHooksPlugin.configs.recommended.rules, | ||
|
||
// Import rules | ||
'import/order': [ | ||
'error', | ||
"import/order": [ | ||
"error", | ||
{ | ||
groups: ['builtin', 'external', 'internal', ['parent', 'sibling'], 'index'], | ||
'newlines-between': 'always', | ||
alphabetize: { order: 'asc', caseInsensitive: true }, | ||
groups: ["builtin", "external", "internal", ["parent", "sibling"], "index"], | ||
"newlines-between": "always", | ||
alphabetize: { order: "asc", caseInsensitive: true }, | ||
}, | ||
], | ||
|
||
// General rules | ||
'no-console': ['warn', { allow: ['warn', 'error'] }], | ||
"no-console": ["warn", { allow: ["warn", "error"] }], | ||
}, | ||
}, | ||
{ | ||
ignores: ['dist/**', 'node_modules/**', 'coverage/**', '.github/**'], | ||
ignores: ["dist/**", "node_modules/**", "coverage/**", ".github/**"], | ||
}, | ||
prettier, | ||
] | ||
]; |
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