Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 21, 2023
1 parent b028923 commit edb8424
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 30 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Expand Up @@ -18,7 +18,11 @@
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" }
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// The following is optional.
Expand Down
18 changes: 3 additions & 15 deletions packages/eslint-config/src/configs/javascript.ts
Expand Up @@ -31,15 +31,13 @@ export const javascript: FlatESLintConfigItem[] = [
},
rules: {
'accessor-pairs': ['error', { enforceForClassMembers: true, setWithoutGet: true }],

'antfu/if-newline': 'error',
'antfu/import-dedupe': 'error',
'antfu/no-import-node-modules-by-path': 'error',

'antfu/top-level-function': 'error',

// best-practice
'array-callback-return': 'error',

'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
'block-scoped-var': 'error',
'camelcase': OFF,
Expand Down Expand Up @@ -77,26 +75,19 @@ export const javascript: FlatESLintConfigItem[] = [
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-eval': 'error',

'no-ex-assign': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',

'no-extra-parens': ['error', 'functions'],
'no-fallthrough': 'error',

'no-floating-decimal': 'error',
'no-func-assign': 'error',
'no-global-assign': 'error',

'no-implied-eval': 'error',
'no-import-assign': 'error',

'no-invalid-regexp': 'error',

'no-invalid-this': 'error',

'no-irregular-whitespace': 'error',
'no-iterator': 'error',
'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
Expand Down Expand Up @@ -183,8 +174,6 @@ export const javascript: FlatESLintConfigItem[] = [
'no-useless-escape': OFF,
'no-useless-rename': 'error',
'no-useless-return': 'error',

// ES6
'no-var': 'error',
'no-void': 'error',
'no-with': 'error',
Expand Down Expand Up @@ -220,7 +209,6 @@ export const javascript: FlatESLintConfigItem[] = [
'quote-props': ['error', 'consistent-as-needed'],
'quotes': ['error', 'single'],
'require-await': OFF,
// Common
'semi': ['error', 'never'],
'sort-imports': [
'error',
Expand All @@ -234,14 +222,14 @@ export const javascript: FlatESLintConfigItem[] = [
],
'symbol-description': 'error',
'unicode-bom': ['error', 'never'],
'unused-imports/no-unused-imports': isInEditor ? OFF : 'error',

'unused-imports/no-unused-imports': isInEditor ? OFF : 'error',
'unused-imports/no-unused-vars': [
'warn',
{ args: 'after-used', argsIgnorePattern: '^_', vars: 'all', varsIgnorePattern: '^_' },
],
'use-isnan': ['error', { enforceForIndexOf: true, enforceForSwitchCase: true }],

'use-isnan': ['error', { enforceForIndexOf: true, enforceForSwitchCase: true }],
'valid-typeof': ['error', { requireStringLiterals: true }],
'vars-on-top': 'error',
'wrap-iife': ['error', 'any', { functionPrototypeMethods: true }],
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/src/configs/jsdoc.ts
Expand Up @@ -8,7 +8,7 @@ export const jsdoc: FlatESLintConfigItem[] = [
jsdoc: pluginJsdoc,
},
rules: {
...pluginJsdoc.configs.recommended.rules,
...pluginJsdoc.configs['flat/recommended-typescript'].rules,
'jsdoc/check-tag-names': OFF,
'jsdoc/check-values': OFF,
'jsdoc/no-undefined-types': OFF,
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-config/src/configs/markdown.ts
Expand Up @@ -28,7 +28,6 @@ export const markdown: FlatESLintConfigItem[] = [
'@typescript-eslint/no-redeclare': OFF,
'@typescript-eslint/no-require-imports': OFF,
'@typescript-eslint/no-unused-vars': OFF,

'@typescript-eslint/no-use-before-define': OFF,
'@typescript-eslint/no-var-requires': OFF,

Expand Down
15 changes: 3 additions & 12 deletions packages/eslint-config/src/plugins.ts
@@ -1,29 +1,20 @@
// @ts-expect-error missing types
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck

export { default as pluginAntfu } from 'eslint-plugin-antfu'
// @ts-expect-error missing types
export { default as pluginComments } from 'eslint-plugin-eslint-comments'
// @ts-expect-error missing types
export { default as pluginImport } from 'eslint-plugin-i'
// @ts-expect-error missing types
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc'
export { default as pluginJsonc } from 'eslint-plugin-jsonc'
// @ts-expect-error missing types
export { default as pluginMarkdown } from 'eslint-plugin-markdown'
// @ts-expect-error missing types
export { default as pluginNode } from 'eslint-plugin-n'
// @ts-expect-error missing types
export { default as pluginStylisticJs } from '@stylistic/eslint-plugin-js'
// @ts-expect-error missing types
export { default as pluginStylisticTs } from '@stylistic/eslint-plugin-ts'
export { default as pluginTs } from '@typescript-eslint/eslint-plugin'
// @ts-expect-error missing types
export { default as pluginUnicorn } from 'eslint-plugin-unicorn'
// @ts-expect-error missing types
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports'
// @ts-expect-error missing types
export { default as pluginVue } from 'eslint-plugin-vue'
export { default as pluginYml } from 'eslint-plugin-yml'
// @ts-expect-error missing types
export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests'

export { default as parserTs } from '@typescript-eslint/parser'
Expand Down

0 comments on commit edb8424

Please sign in to comment.