143 lines
3.6 KiB
JavaScript
143 lines
3.6 KiB
JavaScript
|
|
import globals from "globals";
|
||
|
|
import pluginReact from "eslint-plugin-react";
|
||
|
|
import pluginReactHooks from "eslint-plugin-react-hooks";
|
||
|
|
import pluginTs from "@typescript-eslint/eslint-plugin";
|
||
|
|
import parserTs from "@typescript-eslint/parser";
|
||
|
|
|
||
|
|
export default [
|
||
|
|
{
|
||
|
|
files: ["src/**/*.{ts,tsx}"],
|
||
|
|
languageOptions: {
|
||
|
|
ecmaVersion: "latest",
|
||
|
|
sourceType: "module",
|
||
|
|
globals: {
|
||
|
|
...globals.browser,
|
||
|
|
...globals.node,
|
||
|
|
},
|
||
|
|
parser: parserTs,
|
||
|
|
parserOptions: {
|
||
|
|
ecmaFeatures: {
|
||
|
|
jsx: true,
|
||
|
|
},
|
||
|
|
project: "./tsconfig.json",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
plugins: {
|
||
|
|
react: pluginReact,
|
||
|
|
"react-hooks": pluginReactHooks,
|
||
|
|
"@typescript-eslint": pluginTs,
|
||
|
|
},
|
||
|
|
settings: {
|
||
|
|
react: {
|
||
|
|
version: "detect",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
rules: {
|
||
|
|
...pluginReact.configs.recommended.rules,
|
||
|
|
...pluginReactHooks.configs.recommended.rules,
|
||
|
|
...pluginTs.configs.recommended.rules,
|
||
|
|
"no-unused-vars": "off",
|
||
|
|
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
||
|
|
"no-console": ["warn", { allow: ["warn", "error"] }],
|
||
|
|
"react/react-in-jsx-scope": "off",
|
||
|
|
"react/prop-types": "off",
|
||
|
|
"react/no-unescaped-entities": "off",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
files: ["tests/unit/**/*.test.{ts,tsx}"],
|
||
|
|
languageOptions: {
|
||
|
|
ecmaVersion: "latest",
|
||
|
|
sourceType: "module",
|
||
|
|
globals: {
|
||
|
|
...globals.browser,
|
||
|
|
...globals.node,
|
||
|
|
...globals.vitest,
|
||
|
|
},
|
||
|
|
parser: parserTs,
|
||
|
|
parserOptions: {
|
||
|
|
ecmaFeatures: {
|
||
|
|
jsx: true,
|
||
|
|
},
|
||
|
|
project: "./tsconfig.json",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
plugins: {
|
||
|
|
react: pluginReact,
|
||
|
|
"react-hooks": pluginReactHooks,
|
||
|
|
"@typescript-eslint": pluginTs,
|
||
|
|
},
|
||
|
|
settings: {
|
||
|
|
react: {
|
||
|
|
version: "detect",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
rules: {
|
||
|
|
...pluginReact.configs.recommended.rules,
|
||
|
|
...pluginReactHooks.configs.recommended.rules,
|
||
|
|
...pluginTs.configs.recommended.rules,
|
||
|
|
"no-unused-vars": "off",
|
||
|
|
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
||
|
|
"no-console": ["warn", { allow: ["warn", "error"] }],
|
||
|
|
"react/react-in-jsx-scope": "off",
|
||
|
|
"react/prop-types": "off",
|
||
|
|
"react/no-unescaped-entities": "off",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
files: ["tests/e2e/**/*.ts", "tests/e2e/**/*.tsx"],
|
||
|
|
languageOptions: {
|
||
|
|
ecmaVersion: "latest",
|
||
|
|
sourceType: "module",
|
||
|
|
globals: {
|
||
|
|
...globals.node,
|
||
|
|
},
|
||
|
|
parser: parserTs,
|
||
|
|
parserOptions: {
|
||
|
|
ecmaFeatures: {
|
||
|
|
jsx: false,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
plugins: {
|
||
|
|
"@typescript-eslint": pluginTs,
|
||
|
|
},
|
||
|
|
rules: {
|
||
|
|
...pluginTs.configs.recommended.rules,
|
||
|
|
"no-unused-vars": "off",
|
||
|
|
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
||
|
|
"no-console": ["warn", { allow: ["warn", "error"] }],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
files: ["cli/**/*.{ts,tsx}"],
|
||
|
|
languageOptions: {
|
||
|
|
ecmaVersion: "latest",
|
||
|
|
sourceType: "module",
|
||
|
|
globals: {
|
||
|
|
...globals.node,
|
||
|
|
},
|
||
|
|
parser: parserTs,
|
||
|
|
parserOptions: {
|
||
|
|
ecmaFeatures: {
|
||
|
|
jsx: false,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
plugins: {
|
||
|
|
"@typescript-eslint": pluginTs,
|
||
|
|
},
|
||
|
|
rules: {
|
||
|
|
...pluginTs.configs.recommended.rules,
|
||
|
|
"no-unused-vars": "off",
|
||
|
|
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
||
|
|
"no-console": ["warn", { allow: ["warn", "error"] }],
|
||
|
|
"react/no-unescaped-entities": "off",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
files: ["**/*.ts", "**/*.tsx"],
|
||
|
|
ignores: ["dist/", "node_modules/", "src-tauri/", "target/", "coverage/", "tailwind.config.ts"],
|
||
|
|
},
|
||
|
|
];
|