|
| 1 | +{ |
| 2 | + "$schema": "./node_modules/oxlint/configuration_schema.json", |
| 3 | + "plugins": ["nextjs", "typescript", "react", "jsx-a11y", "import", "unicorn", "oxc", "promise", "node"], |
| 4 | + "categories": { |
| 5 | + "correctness": "warn", |
| 6 | + "suspicious": "warn", |
| 7 | + "perf": "warn" |
| 8 | + }, |
| 9 | + "env": { |
| 10 | + "browser": true, |
| 11 | + "node": true, |
| 12 | + "builtin": true |
| 13 | + }, |
| 14 | + "options": { |
| 15 | + "reportUnusedDisableDirectives": "warn" |
| 16 | + }, |
| 17 | + "ignorePatterns": [".claude", ".next/**", ".velite/**", "out/**", "build/**", "dist/**"], |
| 18 | + "rules": { |
| 19 | + // TypeScript |
| 20 | + "typescript/consistent-type-definitions": ["error", "type"], |
| 21 | + "typescript/no-explicit-any": "error", |
| 22 | + "typescript/no-inferrable-types": "error", |
| 23 | + "typescript/no-duplicate-enum-values": "error", |
| 24 | + "typescript/no-import-type-side-effects": "error", |
| 25 | + "typescript/prefer-includes": "error", |
| 26 | + "typescript/only-throw-error": "error", |
| 27 | + "typescript/return-await": "error", |
| 28 | + "typescript/no-deprecated": "warn", |
| 29 | + |
| 30 | + // Correctness |
| 31 | + "no-unused-vars": "warn", |
| 32 | + "react-hooks/exhaustive-deps": "warn", |
| 33 | + "array-callback-return": "error", |
| 34 | + "no-self-compare": "error", |
| 35 | + "no-constructor-return": "error", |
| 36 | + "no-promise-executor-return": "error", |
| 37 | + "eqeqeq": "error", |
| 38 | + "react/rules-of-hooks": "error", |
| 39 | + |
| 40 | + // Suspicious |
| 41 | + "no-alert": "error", |
| 42 | + "no-template-curly-in-string": "error", |
| 43 | + "no-shadow-restricted-names": "error", |
| 44 | + "no-unused-expressions": "error", |
| 45 | + "no-empty": "error", |
| 46 | + "no-proto": "error", |
| 47 | + "no-return-assign": "error", |
| 48 | + "no-multi-assign": "error", |
| 49 | + "unicorn/no-document-cookie": "error", |
| 50 | + |
| 51 | + // Unicorn |
| 52 | + "unicorn/prefer-set-has": "error", |
| 53 | + "unicorn/no-new-array": "warn", |
| 54 | + "unicorn/no-useless-spread": "warn", |
| 55 | + "unicorn/no-single-promise-in-promise-methods": "warn", |
| 56 | + "unicorn/prefer-node-protocol": "error", |
| 57 | + "unicorn/no-typeof-undefined": "error", |
| 58 | + "unicorn/no-useless-promise-resolve-reject": "error", |
| 59 | + "unicorn/prefer-array-some": "error", |
| 60 | + "unicorn/no-object-as-default-parameter": "warn", |
| 61 | + |
| 62 | + // Noisy rules - disable |
| 63 | + "no-shadow": "off", |
| 64 | + "no-await-in-loop": "off", |
| 65 | + "unicorn/no-array-sort": "off", |
| 66 | + "unicorn/prefer-add-event-listener": "off", |
| 67 | + "unicorn/require-post-message-target-origin": "off", |
| 68 | + "import/no-unassigned-import": "off", |
| 69 | + "import/no-named-as-default": "off", |
| 70 | + "import/no-named-as-default-member": "off", |
| 71 | + "typescript/no-unsafe-type-assertion": "off", |
| 72 | + |
| 73 | + // File size |
| 74 | + "max-lines": ["warn", { "max": 300, "skipBlankLines": true, "skipComments": true }], |
| 75 | + |
| 76 | + // Performance |
| 77 | + "oxc/no-barrel-file": "error", |
| 78 | + "import/no-cycle": "off", |
| 79 | + |
| 80 | + // Next.js |
| 81 | + "@next/next/no-html-link-for-pages": "error", |
| 82 | + "@next/next/no-sync-scripts": "error", |
| 83 | + "@next/next/inline-script-id": "error", |
| 84 | + "@next/next/no-assign-module-variable": "error", |
| 85 | + "@next/next/no-document-import-in-page": "error", |
| 86 | + "@next/next/no-duplicate-head": "error", |
| 87 | + "@next/next/no-head-import-in-document": "error", |
| 88 | + "@next/next/no-script-component-in-head": "error", |
| 89 | + "@next/next/no-img-element": "off", |
| 90 | + |
| 91 | + // React |
| 92 | + "react/jsx-no-target-blank": "off", |
| 93 | + "react/no-unknown-property": "off", |
| 94 | + "react/no-unsafe": "off", |
| 95 | + "react/react-in-jsx-scope": "off", |
| 96 | + |
| 97 | + // jsx-a11y |
| 98 | + "jsx-a11y/alt-text": "warn", |
| 99 | + "jsx-a11y/aria-props": "warn", |
| 100 | + "jsx-a11y/aria-proptypes": "warn", |
| 101 | + "jsx-a11y/aria-unsupported-elements": "warn", |
| 102 | + "jsx-a11y/role-has-required-aria-props": "warn", |
| 103 | + "jsx-a11y/role-supports-aria-props": "warn" |
| 104 | + } |
| 105 | +} |
0 commit comments