mirror of
https://github.com/xlorepdarkhelm/numinar-coding-project.git
synced 2026-09-09 17:45:35 -04:00
79 lines
2.1 KiB
JavaScript
79 lines
2.1 KiB
JavaScript
import js from "@eslint/js";
|
|
import tsParser from "@typescript-eslint/parser";
|
|
import tsPlugin from "@typescript-eslint/eslint-plugin";
|
|
import reactPlugin from "eslint-plugin-react";
|
|
import jestPlugin from "eslint-plugin-jest";
|
|
|
|
// ESLint v9+ config for NuminarCodingProject frontend
|
|
export default [
|
|
js.configs.recommended,
|
|
{
|
|
files: ["src/**/*.{ts,tsx,js,jsx}"],
|
|
ignores: ["**/node_modules/**", "**/dist/**", "**/build/**"], // Do NOT ignore src/
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
ecmaVersion: 2021,
|
|
sourceType: "module",
|
|
globals: {
|
|
window: "readonly",
|
|
document: "readonly",
|
|
process: "readonly",
|
|
EventSource: "readonly",
|
|
MessageEvent: "readonly",
|
|
Event: "readonly",
|
|
HTMLFormElement: "readonly",
|
|
HTMLDivElement: "readonly",
|
|
BeforeUnloadEvent: "readonly",
|
|
setTimeout: "readonly",
|
|
getComputedStyle: "readonly",
|
|
},
|
|
},
|
|
plugins: {
|
|
react: reactPlugin,
|
|
"@typescript-eslint": tsPlugin,
|
|
},
|
|
rules: {
|
|
"no-unused-vars": "warn",
|
|
"no-console": "warn",
|
|
eqeqeq: "error",
|
|
curly: "error",
|
|
semi: ["error", "always"],
|
|
"react/jsx-uses-react": "error",
|
|
"react/jsx-uses-vars": "error",
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
},
|
|
settings: {
|
|
react: {
|
|
version: "detect",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
files: ["src/__tests__/**/*.{ts,tsx,js,jsx}", "src/setupTests.ts"],
|
|
plugins: { jest: jestPlugin },
|
|
languageOptions: {
|
|
ecmaVersion: 2021,
|
|
sourceType: "module",
|
|
globals: {
|
|
describe: "readonly",
|
|
it: "readonly",
|
|
beforeAll: "readonly",
|
|
afterAll: "readonly",
|
|
beforeEach: "readonly",
|
|
afterEach: "readonly",
|
|
expect: "readonly",
|
|
jest: "readonly",
|
|
test: "readonly",
|
|
global: "readonly",
|
|
console: "readonly",
|
|
},
|
|
},
|
|
rules: {
|
|
"jest/no-disabled-tests": "warn",
|
|
"jest/no-focused-tests": "error",
|
|
"jest/no-identical-title": "error",
|
|
"jest/no-mocks-import": "error",
|
|
},
|
|
},
|
|
];
|