-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
64 lines (59 loc) · 2.95 KB
/
.eslintrc.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
"ignorePatterns": ["next-env.d.ts", "*.d.ts", "*.config.js"],
"parserOptions": {
"project": ["./tsconfig.json"]
},
"globals": {
"JSX": "readonly",
"NodeJS": "readonly"
},
"overrides": [
{
// https://github.com/shadcn-ui/ui/issues/120#issuecomment-1828081539
"files": ["**/components/ui/*.tsx", "**/utilities/env.ts"],
"rules": {
"react/prop-types": "off",
"@typescript-eslint/no-empty-object-type": "off"
}
}
],
"extends": ["next/core-web-vitals", "next/typescript", "plugin:tailwindcss/recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/strict", "plugin:jsx-a11y/strict", "airbnb"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"rules": {
"indent": ["error", "tab", { "SwitchCase": 1 }],
"quotes": ["error", "double"],
"no-tabs": ["error", { "allowIndentationTabs": true }],
"eol-last": ["error", "never"],
"no-shadow": "off", // -> @typescript-eslint/no-shadow
"camelcase": ["error", { "properties": "never", "ignoreImports": true, "ignoreDestructuring": false }],
"no-plusplus": "off",
"brace-style": ["error", "allman"],
"comma-dangle": ["error", "never"],
"no-unused-vars": "off", // -> @typescript-eslint/no-unused-vars
"linebreak-style": "off",
"space-in-parens": ["error", "always"],
"no-param-reassign": ["error", { "props": false }],
"operator-linebreak": ["error", "before", { "overrides": { "=": "after" } }],
"no-underscore-dangle": ["error", { "allow": ["_def", "_count"] }], // https://github.com/vercel/next.js/issues/52201#issuecomment-1620629437
"object-curly-newline": ["error", { "ImportDeclaration": { "minProperties": 0 }}],
"array-bracket-spacing": ["error", "always"],
"template-curly-spacing": ["error", "always"],
"computed-property-spacing": ["error", "always"],
"import/extensions": ["error", "never", { "json": "ignorePackages" }],
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": "off",
"jsx-a11y/html-has-lang": "off", // Layout avec Google Fonts
"tailwindcss/no-custom-classname": ["warn", { "whitelist": ["toaster", "cc--darkmode"] }], // https://sonner.emilkowal.ski/ + https://ui.shadcn.com/docs/components/sonner
"@typescript-eslint/no-shadow": "error",
"react/no-danger": "off", // https://github.com/pacocoursey/next-themes/blob/cd67bfa20ef6ea78a814d65625c530baae4075ef/packages/next-themes/src/index.tsx#L267
"react/jsx-indent": ["error", "tab"],
"react/jsx-indent-props": ["error", "tab"],
"react/react-in-jsx-scope": "off", // https://stackoverflow.com/a/61160875
"react/require-default-props": ["error", { "functions": "defaultArguments" }], // https://github.com/jsx-eslint/eslint-plugin-react/issues/2396
"react/jsx-filename-extension": [1, { "extensions": [".jsx", ".tsx"] }],
"react/jsx-props-no-spreading": "off",
"react/jsx-one-expression-per-line": "off",
"react/no-unstable-nested-components": "off" // https://next-intl-docs.vercel.app/docs/usage/messages#rich-text
}
}