Files
next-app-template/oxlint.config.ts
T
2026-04-01 22:01:53 +03:00

106 lines
3.1 KiB
TypeScript

import type { OxlintConfig } from 'oxlint';
export default {
plugins: ['react', 'typescript', 'jsx-a11y', 'jest'],
ignorePatterns: ['**/*.{mjs,cjs,js,d.ts,d.mts}', '.next', 'storybook-static'],
rules: {
'array-callback-return': 'error',
'no-duplicate-imports': 'error',
'no-var': 'error',
'no-self-compare': 'error',
'no-template-curly-in-string': 'error',
curly: 'error',
'default-case': 'off',
'default-case-last': 'error',
'no-alert': 'error',
'no-console': 'error',
'no-else-return': 'error',
'no-eval': 'error',
'no-lonely-if': 'error',
'no-multi-assign': 'error',
'no-multi-str': 'error',
'no-param-reassign': 'error',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unneeded-ternary': 'error',
'no-useless-call': 'error',
'no-useless-constructor': 'error',
'no-useless-return': 'error',
'operator-assignment': 'error',
'prefer-const': 'error',
'prefer-exponentiation-operator': 'error',
'prefer-object-has-own': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-template': 'error',
radix: 'error',
yoda: 'error',
eqeqeq: ['error', 'smart'],
'no-empty': 'off',
'no-loop-func': 'off',
'no-redeclare': 'off',
'no-undef': 'off',
'no-unused-expressions': 'off',
'no-use-before-define': 'off',
'typescript/ban-ts-comment': 'off',
'typescript/consistent-generic-constructors': 'error',
'typescript/no-deprecated': 'warn',
'typescript/no-empty-object-type': 'off',
'typescript/no-explicit-any': 'off',
'typescript/no-namespace': 'off',
'typescript/no-unsafe-function-type': 'off',
'no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'none',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'react/button-has-type': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-curly-brace-presence': [
'error',
{ props: 'never', children: 'never', propElementValues: 'ignore' },
],
'react/jsx-fragments': ['error', 'syntax'],
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-target-blank': 'error',
'react/no-children-prop': 'error',
'react/no-find-dom-node': 'error',
'react/no-string-refs': 'error',
'react/self-closing-comp': 'error',
'react/void-dom-elements-no-children': 'error',
'jsx-a11y/anchor-has-content': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/mouse-events-have-key-events': 'off',
'jsx-a11y/no-autofocus': 'off',
'jest/expect-expect': 'off',
'jest/no-export': 'off',
'jest/valid-title': 'off',
},
overrides: [
{
files: ['**/*.story.tsx'],
rules: {
'no-console': 'off',
'react/button-has-type': 'off',
},
},
],
} satisfies OxlintConfig;