All checks were successful
Build ESLint Config and Release / build-and-release (push) Successful in 2s
65 lines
1.6 KiB
JavaScript
65 lines
1.6 KiB
JavaScript
import js from "@eslint/js";
|
||
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";
|
||
import importPlugin from "eslint-plugin-import";
|
||
import unusedImports from "eslint-plugin-unused-imports";
|
||
|
||
export default [
|
||
/* Base JS rules (all files) */
|
||
js.configs.recommended,
|
||
|
||
/* TypeScript – typed, scoped, flat-config correct */
|
||
...tseslint.configs.recommendedTypeChecked.map(config => ({
|
||
...config,
|
||
files: ["**/*.ts", "**/*.tsx"],
|
||
languageOptions: {
|
||
...config.languageOptions,
|
||
parserOptions: {
|
||
projectService: true,
|
||
},
|
||
},
|
||
})),
|
||
|
||
/* React */
|
||
react.configs.flat.recommended,
|
||
|
||
/* React Hooks */
|
||
{
|
||
plugins: {
|
||
"react-hooks": reactHooks,
|
||
},
|
||
rules: reactHooks.configs.recommended.rules,
|
||
},
|
||
|
||
/* JSX Accessibility */
|
||
a11y.flatConfigs.recommended,
|
||
|
||
/* Import rules */
|
||
importPlugin.flatConfigs.recommended,
|
||
|
||
/* Unused imports */
|
||
{
|
||
plugins: {
|
||
"unused-imports": unusedImports,
|
||
},
|
||
rules: {
|
||
"unused-imports/no-unused-imports": "error",
|
||
"unused-imports/no-unused-vars": [
|
||
"warn",
|
||
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
||
],
|
||
},
|
||
},
|
||
|
||
/* React version detection */
|
||
{
|
||
settings: {
|
||
react: {
|
||
version: "detect",
|
||
},
|
||
},
|
||
},
|
||
];
|