Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98e16522c3 | |||
| 8222bfb350 | |||
| dc26326eab |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sebastianbrenner/eslint-config",
|
||||
"version": "1.1.1",
|
||||
"version": "1.2.0",
|
||||
"type": "module",
|
||||
"main": "./index.js",
|
||||
"scripts": {
|
||||
|
||||
39
src/index.js
39
src/index.js
@@ -7,14 +7,20 @@ import importPlugin from "eslint-plugin-import";
|
||||
import unusedImports from "eslint-plugin-unused-imports";
|
||||
|
||||
export default [
|
||||
/* JS (all files, no type info) */
|
||||
/* Base JS rules (all files) */
|
||||
js.configs.recommended,
|
||||
|
||||
/* TypeScript with type checking (ONLY TS files) */
|
||||
{
|
||||
/* TypeScript – typed, scoped, flat-config correct */
|
||||
...tseslint.configs.recommendedTypeChecked.map(config => ({
|
||||
...config,
|
||||
files: ["**/*.ts", "**/*.tsx"],
|
||||
...tseslint.configs.recommendedTypeChecked,
|
||||
},
|
||||
languageOptions: {
|
||||
...config.languageOptions,
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
},
|
||||
},
|
||||
})),
|
||||
|
||||
/* React */
|
||||
react.configs.flat.recommended,
|
||||
@@ -27,10 +33,10 @@ export default [
|
||||
rules: reactHooks.configs.recommended.rules,
|
||||
},
|
||||
|
||||
/* JSX a11y */
|
||||
/* JSX Accessibility */
|
||||
a11y.flatConfigs.recommended,
|
||||
|
||||
/* Imports */
|
||||
/* Import rules */
|
||||
importPlugin.flatConfigs.recommended,
|
||||
|
||||
/* Unused imports */
|
||||
@@ -46,4 +52,23 @@ export default [
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
/* React version detection */
|
||||
{
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
"import/resolver": {
|
||||
typescript: {
|
||||
project : "./tsconfig.json",
|
||||
},
|
||||
},
|
||||
"import/resolver": {
|
||||
"node": {
|
||||
"extensions": [".js", ".jsx", ".ts", ".tsx"]
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user