Skip to content

Commit

Permalink
feat: customize unicorn rules
Browse files Browse the repository at this point in the history
  • Loading branch information
nekochan0122 committed Aug 28, 2024
1 parent 3f88e8f commit 21d218b
Showing 1 changed file with 39 additions and 6 deletions.
45 changes: 39 additions & 6 deletions src/eslint/plugins/unicorn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,47 @@ import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import type { FlatConfigArray } from '~/eslint/types'

export const unicornPluginConfig: FlatConfigArray = [
eslintPluginUnicorn.configs['flat/recommended'],
{
plugins: {
unicorn: eslintPluginUnicorn,
},
rules: {
'unicorn/no-null': 'off',
'unicorn/prefer-export-from': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/better-regex': 'error',
'unicorn/filename-case': 'error',
'unicorn/no-array-for-each': 'error',
'unicorn/no-array-push-push': 'error',
'unicorn/no-empty-file': 'error',
'unicorn/no-for-loop': 'error',
'unicorn/no-instanceof-array': 'error',
'unicorn/no-invalid-fetch-options': 'error',
'unicorn/no-unnecessary-await': 'error',
'unicorn/no-useless-undefined': 'error',
'unicorn/no-zero-fractions': 'error',
'unicorn/number-literal-case': 'error',
'unicorn/numeric-separators-style': 'error',
'unicorn/prefer-at': 'error',
'unicorn/prefer-date-now': 'error',
'unicorn/prefer-dom-node-append': 'error',
'unicorn/prefer-dom-node-dataset': 'error',
'unicorn/prefer-dom-node-remove': 'error',
'unicorn/prefer-dom-node-text-content': 'error',
'unicorn/prefer-includes': 'error',
'unicorn/prefer-keyboard-event-key': 'error',
'unicorn/prefer-modern-dom-apis': 'error',
'unicorn/prefer-modern-math-apis': 'error',
'unicorn/prefer-module': 'error',
'unicorn/prefer-node-protocol': 'error',
'unicorn/prefer-query-selector': 'error',
'unicorn/prefer-regexp-test': 'error',
'unicorn/prefer-spread': 'error',
'unicorn/prefer-string-raw': 'error',
'unicorn/prefer-string-replace-all': 'error',
'unicorn/prefer-string-slice': 'error',
'unicorn/prefer-string-starts-ends-with': 'error',
'unicorn/prefer-structured-clone': 'error',
'unicorn/prefer-switch': 'error',
'unicorn/relative-url-style': 'error',
'unicorn/throw-new-error': 'error',
},
},
]

0 comments on commit 21d218b

Please sign in to comment.