mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
135 lines
3.3 KiB
JSON
135 lines
3.3 KiB
JSON
{
|
|
"env": {
|
|
"browser": true,
|
|
"shared-node-browser": true,
|
|
"node": true,
|
|
"es6": true
|
|
},
|
|
"extends": [
|
|
"eslint:recommended",
|
|
"plugin:@typescript-eslint/recommended",
|
|
"prettier",
|
|
"plugin:prettier/recommended",
|
|
"plugin:react-hooks/recommended",
|
|
"plugin:import/errors",
|
|
"plugin:import/warnings"
|
|
],
|
|
"plugins": [
|
|
"@typescript-eslint",
|
|
"react",
|
|
"prettier",
|
|
"react-hooks",
|
|
"import",
|
|
"@vitest",
|
|
"jest-dom",
|
|
"testing-library",
|
|
"eslint-plugin-react-compiler"
|
|
],
|
|
"parser": "@typescript-eslint/parser",
|
|
"parserOptions": {
|
|
"ecmaVersion": 2018,
|
|
"sourceType": "module",
|
|
"ecmaFeatures": {
|
|
"jsx": true
|
|
}
|
|
},
|
|
"rules": {
|
|
"react-compiler/react-compiler": "warn",
|
|
"eqeqeq": "error",
|
|
"no-var": "error",
|
|
"prefer-const": "error",
|
|
"curly": ["warn", "multi-line", "consistent"],
|
|
"no-console": "off",
|
|
"import/extensions": ["error", "always"],
|
|
"import/no-unresolved": ["error", { "commonjs": true, "amd": true }],
|
|
"import/export": "error",
|
|
"import/no-duplicates": ["error"],
|
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }
|
|
],
|
|
"@typescript-eslint/no-use-before-define": "off",
|
|
"@typescript-eslint/no-empty-function": "off",
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"import/namespace": "off",
|
|
"import/named": "off",
|
|
"import/order": [
|
|
"error",
|
|
{
|
|
"alphabetize": { "order": "asc", "caseInsensitive": true },
|
|
"groups": [
|
|
"builtin",
|
|
"external",
|
|
"internal",
|
|
"parent",
|
|
"sibling",
|
|
"index",
|
|
"object"
|
|
],
|
|
"newlines-between": "never",
|
|
"pathGroups": [
|
|
{
|
|
"pattern": "react",
|
|
"group": "builtin",
|
|
"position": "before"
|
|
}
|
|
],
|
|
"pathGroupsExcludedImportTypes": ["builtin"]
|
|
}
|
|
],
|
|
"react/jsx-uses-react": "off",
|
|
"react/react-in-jsx-scope": "off",
|
|
"sort-imports": [
|
|
"error",
|
|
{
|
|
"ignoreDeclarationSort": true
|
|
}
|
|
]
|
|
},
|
|
"settings": {
|
|
"react": {
|
|
"version": "detect"
|
|
},
|
|
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
|
|
"import/parsers": {
|
|
"@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"]
|
|
},
|
|
"import/resolver": {
|
|
"alias": {
|
|
"extensions": [".js", ".jsx", ".ts", ".tsx"],
|
|
"map": [
|
|
["^zustand$", "./src/index.ts"],
|
|
["zustand", "./src"]
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"overrides": [
|
|
{
|
|
"extends": [
|
|
"plugin:jest-dom/recommended",
|
|
"plugin:testing-library/react",
|
|
"plugin:@vitest/legacy-recommended"
|
|
],
|
|
"files": ["tests/**/*.ts", "tests/**/*.tsx"],
|
|
"rules": {
|
|
"testing-library/no-node-access": "off",
|
|
"import/extensions": ["error", "never"],
|
|
"@vitest/expect-expect": "off",
|
|
"@vitest/consistent-test-it": [
|
|
"error",
|
|
{ "fn": "it", "withinDescribe": "it" }
|
|
],
|
|
"@typescript-eslint/no-unused-vars": "off"
|
|
}
|
|
},
|
|
{
|
|
"files": ["./*.js"],
|
|
"rules": {
|
|
"@typescript-eslint/no-require-imports": "off"
|
|
}
|
|
}
|
|
]
|
|
}
|