generated from bradgarropy/eslint-config-bradgarropy
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1ab3cf3
commit f4ab14b
Showing
7 changed files
with
2,648 additions
and
606 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 @@ | ||
22 |
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,94 +1,95 @@ | ||
import path from "node:path" | ||
import {fileURLToPath} from "node:url" | ||
|
||
import {includeIgnoreFile} from "@eslint/compat" | ||
import js from "@eslint/js" | ||
import prettier from "eslint-config-prettier" | ||
import importSort from "eslint-plugin-simple-import-sort" | ||
import vitest from "@vitest/eslint-plugin" | ||
import jsxA11y from "eslint-plugin-jsx-a11y" | ||
import react from "eslint-plugin-react" | ||
import reactHooks from "eslint-plugin-react-hooks" | ||
import simpleImportSort from "eslint-plugin-simple-import-sort" | ||
import globals from "globals" | ||
import tseslint from "typescript-eslint" | ||
import ts from "typescript-eslint" | ||
|
||
const filename = fileURLToPath(import.meta.url) | ||
const dirname = path.dirname(filename) | ||
const gitignore = path.resolve(dirname, ".gitignore") | ||
|
||
const config = [ | ||
const config = ts.config([ | ||
includeIgnoreFile(gitignore), | ||
{ | ||
ignores: ["build", "coverage"], | ||
}, | ||
js.configs.recommended, | ||
ts.configs.recommended, | ||
react.configs.flat.recommended, | ||
react.configs.flat["jsx-runtime"], | ||
jsxA11y.flatConfigs.recommended, | ||
{ | ||
files: [ | ||
"**/*.js", | ||
"**/*.cjs", | ||
"**/*.mjs", | ||
"**/*.jsx", | ||
"**/*.ts", | ||
"**/*.cts", | ||
"**/*.mts", | ||
"**/*.tsx", | ||
], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
...globals.es2025, | ||
...globals.jest, | ||
...globals.es2021, | ||
...globals.node, | ||
}, | ||
parser: tseslint.parser, | ||
parserOptions: { | ||
ecmaFeatures: {}, | ||
project: "./tsconfig.json", | ||
requireConfigFile: false, | ||
projectService: true, | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
sourceType: "module", | ||
}, | ||
}, | ||
js.configs.recommended, | ||
prettier, | ||
{ | ||
plugins: { | ||
"simple-import-sort": importSort, | ||
"simple-import-sort": simpleImportSort, | ||
"react-hooks": reactHooks, | ||
"vitest": vitest, | ||
}, | ||
settings: { | ||
react: { | ||
version: "19", | ||
}, | ||
}, | ||
}, | ||
{ | ||
rules: { | ||
"comma-dangle": ["error", "always-multiline"], | ||
"comma-spacing": [ | ||
...reactHooks.configs.recommended.rules, | ||
...vitest.configs.recommended.rules, | ||
"@typescript-eslint/consistent-type-imports": [ | ||
"error", | ||
{ | ||
before: false, | ||
after: true, | ||
prefer: "type-imports", | ||
disallowTypeAnnotations: true, | ||
fixStyle: "separate-type-imports", | ||
}, | ||
], | ||
"comma-style": ["error", "last"], | ||
"eol-last": ["error", "always"], | ||
"eqeqeq": ["error", "always"], | ||
"function-paren-newline": ["off"], | ||
"indent": ["off"], | ||
"no-console": ["off"], | ||
"no-mixed-spaces-and-tabs": ["error"], | ||
"no-unused-vars": [ | ||
"@typescript-eslint/consistent-type-exports": ["error"], | ||
"@typescript-eslint/no-import-type-side-effects": ["error"], | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
"object-curly-newline": [ | ||
"error", | ||
{ | ||
consistent: true, | ||
}, | ||
], | ||
"object-curly-spacing": ["error", "never"], | ||
"object-property-newline": [ | ||
"error", | ||
{ | ||
allowAllPropertiesOnSameLine: true, | ||
}, | ||
], | ||
"eqeqeq": ["error", "always"], | ||
"function-paren-newline": ["off"], | ||
"indent": ["off"], | ||
"jsx-a11y/accessible-emoji": ["off"], | ||
"no-console": ["off"], | ||
"prefer-const": ["error"], | ||
"quote-props": ["error", "consistent-as-needed"], | ||
"quotes": ["error", "double"], | ||
"semi": ["error", "never"], | ||
"semi-spacing": [ | ||
"error", | ||
{ | ||
before: false, | ||
after: true, | ||
}, | ||
], | ||
"semi-style": ["error", "last"], | ||
"react-hooks/rules-of-hooks": ["error"], | ||
"react-hooks/exhaustive-deps": ["error"], | ||
"simple-import-sort/imports": ["error"], | ||
"simple-import-sort/exports": ["error"], | ||
"space-before-function-paren": [ | ||
"error", | ||
{ | ||
anonymous: "never", | ||
named: "never", | ||
asyncArrow: "always", | ||
}, | ||
], | ||
}, | ||
}, | ||
] | ||
]) | ||
|
||
export default config |
Oops, something went wrong.