Skip to content

Commit

Permalink
test slowest rules
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Nov 6, 2024
1 parent 97cbd9e commit 641d4b0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 51 deletions.
18 changes: 13 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ export default tseslint.config({
files: ['packages/global.d.ts', 'packages/*/src/**/*.ts'],
extends: [tseslint.configs.base],
rules: {
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/strict-boolean-expressions': 'warn',
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
'@typescript-eslint/no-unnecessary-condition': 'warn',
// '@typescript-eslint/no-unnecessary-type-assertion': 'warn',
// '@typescript-eslint/prefer-nullish-coalescing': 'warn',
// '@typescript-eslint/strict-boolean-expressions': 'warn',
// '@typescript-eslint/switch-exhaustiveness-check': 'warn',
// '@typescript-eslint/no-unnecessary-condition': 'warn',

'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
},
})
62 changes: 16 additions & 46 deletions tsslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,52 +1,22 @@
import { defineConfig } from '@tsslint/config'
import { convertRule } from '@tsslint/eslint'
import { loadPluginRules } from '@tsslint/eslint'

export default defineConfig({
rules: {
'no-unnecessary-type-assertion': convertRule(
(
await import(
'./node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js'
)
).default.default,
[],
0,
),
'prefer-nullish-coalescing': convertRule(
(
await import(
'./node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js'
)
).default.default,
[],
0,
),
'strict-boolean-expressions': convertRule(
(
await import(
'./node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js'
)
).default.default,
[],
0,
),
'switch-exhaustiveness-check': convertRule(
(
await import(
'./node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js'
)
).default.default,
[],
0,
),
'no-unnecessary-condition': convertRule(
(
await import(
'./node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js'
)
).default.default,
[],
0,
),
...await loadPluginRules({
// 'no-unnecessary-type-assertion': 'warn',
// 'prefer-nullish-coalescing': 'warn',
// 'strict-boolean-expressions': 'warn',
// 'switch-exhaustiveness-check': 'warn',
// 'no-unnecessary-condition': 'warn',

'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
}),
},
})

0 comments on commit 641d4b0

Please sign in to comment.