Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8222bfb350 | |||
| dc26326eab | |||
| 0077ffb3c9 | |||
| c9cd6fc0cc |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sebastianbrenner/eslint-config",
|
||||
"version": "1.0.5",
|
||||
"version": "1.1.3",
|
||||
"type": "module",
|
||||
"main": "./index.js",
|
||||
"scripts": {
|
||||
@@ -12,7 +12,6 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "5",
|
||||
"@typescript-eslint/eslint-plugin": "8.48.1",
|
||||
"@typescript-eslint/parser": "8.48.1",
|
||||
"eslint": "^9.0.0",
|
||||
"eslint-plugin-import": "2.32.0",
|
||||
|
||||
64
src/index.js
64
src/index.js
@@ -1,6 +1,5 @@
|
||||
import js from "@eslint/js";
|
||||
import tseslint from "@typescript-eslint/eslint-plugin";
|
||||
import tsParser from "@typescript-eslint/parser";
|
||||
import tseslint from "typescript-eslint";
|
||||
import react from "eslint-plugin-react";
|
||||
import reactHooks from "eslint-plugin-react-hooks";
|
||||
import a11y from "eslint-plugin-jsx-a11y";
|
||||
@@ -8,57 +7,58 @@ import importPlugin from "eslint-plugin-import";
|
||||
import unusedImports from "eslint-plugin-unused-imports";
|
||||
|
||||
export default [
|
||||
/* Core ESLint recommended rules */
|
||||
/* Base JS rules (all files) */
|
||||
js.configs.recommended,
|
||||
|
||||
/* TypeScript recommended */
|
||||
{
|
||||
/* TypeScript – typed, scoped, flat-config correct */
|
||||
...tseslint.configs.recommendedTypeChecked.map(config => ({
|
||||
...config,
|
||||
files: ["**/*.ts", "**/*.tsx"],
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
...config.languageOptions,
|
||||
parserOptions: {
|
||||
project: true
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
"@typescript-eslint": tseslint
|
||||
projectService: true,
|
||||
},
|
||||
},
|
||||
})),
|
||||
|
||||
...tseslint.configs["recommended-type-checked"]
|
||||
},
|
||||
|
||||
/* React recommended */
|
||||
/* React */
|
||||
react.configs.flat.recommended,
|
||||
|
||||
/* React Hooks recommended */
|
||||
/* React Hooks */
|
||||
{
|
||||
plugins: { "react-hooks": reactHooks },
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules
|
||||
}
|
||||
plugins: {
|
||||
"react-hooks": reactHooks,
|
||||
},
|
||||
rules: reactHooks.configs.recommended.rules,
|
||||
},
|
||||
|
||||
|
||||
/* JSX Accessibility recommended */
|
||||
/* JSX Accessibility */
|
||||
a11y.flatConfigs.recommended,
|
||||
|
||||
/* Import validation rules */
|
||||
/* Import rules */
|
||||
importPlugin.flatConfigs.recommended,
|
||||
|
||||
/* Unused imports */
|
||||
{
|
||||
plugins: { "unused-imports": unusedImports },
|
||||
plugins: {
|
||||
"unused-imports": unusedImports,
|
||||
},
|
||||
rules: {
|
||||
"unused-imports/no-unused-imports": "error",
|
||||
"unused-imports/no-unused-vars": [
|
||||
"warn",
|
||||
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" }
|
||||
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
||||
],
|
||||
'@stylistic/indent': ['error', 4],
|
||||
'@stylistic/semi': ['error', 'always'],
|
||||
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
|
||||
'@stylistic/no-trailing-spaces': 'error',
|
||||
'@stylistic/no-multiple-empty-lines': 'error',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
/* React version detection */
|
||||
{
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user