Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0077ffb3c9 | |||
| c9cd6fc0cc |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sebastianbrenner/eslint-config",
|
"name": "@sebastianbrenner/eslint-config",
|
||||||
"version": "1.0.5",
|
"version": "1.1.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "5",
|
"typescript": "5",
|
||||||
"@typescript-eslint/eslint-plugin": "8.48.1",
|
|
||||||
"@typescript-eslint/parser": "8.48.1",
|
"@typescript-eslint/parser": "8.48.1",
|
||||||
"eslint": "^9.0.0",
|
"eslint": "^9.0.0",
|
||||||
"eslint-plugin-import": "2.32.0",
|
"eslint-plugin-import": "2.32.0",
|
||||||
|
|||||||
51
src/index.js
51
src/index.js
@@ -1,6 +1,5 @@
|
|||||||
import js from "@eslint/js";
|
import js from "@eslint/js";
|
||||||
import tseslint from "@typescript-eslint/eslint-plugin";
|
import tseslint from "typescript-eslint";
|
||||||
import tsParser from "@typescript-eslint/parser";
|
|
||||||
import react from "eslint-plugin-react";
|
import react from "eslint-plugin-react";
|
||||||
import reactHooks from "eslint-plugin-react-hooks";
|
import reactHooks from "eslint-plugin-react-hooks";
|
||||||
import a11y from "eslint-plugin-jsx-a11y";
|
import a11y from "eslint-plugin-jsx-a11y";
|
||||||
@@ -8,57 +7,43 @@ import importPlugin from "eslint-plugin-import";
|
|||||||
import unusedImports from "eslint-plugin-unused-imports";
|
import unusedImports from "eslint-plugin-unused-imports";
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
/* Core ESLint recommended rules */
|
/* JS (all files, no type info) */
|
||||||
js.configs.recommended,
|
js.configs.recommended,
|
||||||
|
|
||||||
/* TypeScript recommended */
|
/* TypeScript with type checking (ONLY TS files) */
|
||||||
{
|
{
|
||||||
files: ["**/*.ts", "**/*.tsx"],
|
files: ["**/*.ts", "**/*.tsx"],
|
||||||
languageOptions: {
|
...tseslint.configs.recommendedTypeChecked,
|
||||||
parser: tsParser,
|
|
||||||
parserOptions: {
|
|
||||||
project: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
plugins: {
|
|
||||||
"@typescript-eslint": tseslint
|
|
||||||
},
|
|
||||||
|
|
||||||
...tseslint.configs["recommended-type-checked"]
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* React recommended */
|
/* React */
|
||||||
react.configs.flat.recommended,
|
react.configs.flat.recommended,
|
||||||
|
|
||||||
/* React Hooks recommended */
|
/* React Hooks */
|
||||||
{
|
{
|
||||||
plugins: { "react-hooks": reactHooks },
|
plugins: {
|
||||||
rules: {
|
"react-hooks": reactHooks,
|
||||||
...reactHooks.configs.recommended.rules
|
},
|
||||||
}
|
rules: reactHooks.configs.recommended.rules,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/* JSX a11y */
|
||||||
/* JSX Accessibility recommended */
|
|
||||||
a11y.flatConfigs.recommended,
|
a11y.flatConfigs.recommended,
|
||||||
|
|
||||||
/* Import validation rules */
|
/* Imports */
|
||||||
importPlugin.flatConfigs.recommended,
|
importPlugin.flatConfigs.recommended,
|
||||||
|
|
||||||
/* Unused imports */
|
/* Unused imports */
|
||||||
{
|
{
|
||||||
plugins: { "unused-imports": unusedImports },
|
plugins: {
|
||||||
|
"unused-imports": unusedImports,
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
"unused-imports/no-unused-imports": "error",
|
"unused-imports/no-unused-imports": "error",
|
||||||
"unused-imports/no-unused-vars": [
|
"unused-imports/no-unused-vars": [
|
||||||
"warn",
|
"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',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user