Skip to content

Commit

Permalink
feat: adopt [email protected] rules
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Sep 14, 2024
1 parent d28ccb7 commit 212f577
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 200 deletions.
16 changes: 15 additions & 1 deletion cfg/biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"files": {
"ignore": ["**/tsconfig.json", "**/tsconfig.*.json", "**/__exclude", "**/try.ts", "*.compact.json"]
},
Expand All @@ -18,15 +18,23 @@
"rules": {
"recommended": true,
"performance": {
// "useTopLevelRegex": "error" // consider
"noDelete": "off" // todo
},
"correctness": {
// "useImportExtensions": "error", // consider for esm later
"noUnusedFunctionParameters": "error",
// noUnusedImports + noUnusedVariables can replace eslint-plugin-unused-vars!
"noUnusedImports": "error",
"noUnusedVariables": "error",
"useArrayLiterals": "error"
},
"style": {
// "useDefaultSwitchClause": "error", // consider`
"useThrowNewError": "error",
"useThrowOnlyError": "error",
"useConsistentBuiltinInstantiation": "error",
"noDoneCallback": "error",
"useShorthandFunctionType": "error",
"useShorthandAssign": "error",
"useForOf": "error",
Expand All @@ -43,6 +51,9 @@
"noUnusedTemplateLiteral": "off"
},
"suspicious": {
"useNumberToFixedDigitsArgument": "error",
"useErrorMessage": "error",
"noEvolvingTypes": "error",
"noExplicitAny": "off",
"noAssignInExpressions": "off",
"noPrototypeBuiltins": "off",
Expand All @@ -52,6 +63,9 @@
"noEmptyInterface": "off"
},
"complexity": {
"useDateNow": "error",
"noUselessUndefinedInitialization": "error",
"noUselessStringConcat": "error",
"noForEach": "off",
"noUselessThisAlias": "off",
"useLiteralKeys": "off",
Expand Down
6 changes: 6 additions & 0 deletions cfg/eslint-biome-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module.exports = {
'no-shadow-restricted-names': 0,
'no-sparse-array': 0,
'no-this-before-super': 0,
'no-undef-init': 0,
'no-unneeded-ternary': 0,
'no-unreachable': 0,
'no-unsafe-finally': 0,
Expand Down Expand Up @@ -158,14 +159,19 @@ module.exports = {
'react-hooks/exhaustive-deps': 0,
// "simple-import-sort/imports": 0, // we need it
'stylistic/jsx-self-closing-comp': 0,
'unicorn/error-message': 0,
'unicorn/new-for-builtins': 0,
'unicorn/no-array-for-each': 0,
'unicorn/no-instanceof-array': 0,
'unicorn/no-static-only-class': 0,
'unicorn/no-thenable': 0,
'unicorn/no-typeof-undefined': 0,
'unicorn/no-useless-switch-case': 0,
'unicorn/prefer-array-flat-map': 0,
'unicorn/prefer-date-now': 0,
'unicorn/prefer-node-protocol': 0,
'unicorn/prefer-number-properties': 0,
'unicorn/require-number-to-fixed-digits-argument': 0,
'unicorn/throw-new-error': 0,
},
}
4 changes: 1 addition & 3 deletions cfg/eslint-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ module.exports = {
'no-irregular-whitespace': 2,
'no-misleading-character-class': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-prototype-builtins': 2,
Expand Down Expand Up @@ -267,9 +266,8 @@ module.exports = {
'no-shadow-restricted-names': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'@typescript-eslint/only-throw-error': 2,
'@typescript-eslint/only-throw-error': 0, // biome
'no-undef': 0, // covered by TS, conflicts with typescript-eslint
'no-undef-init': 2,
'no-underscore-dangle': 0,
'no-unreachable': 2,
'no-unsafe-finally': 2,
Expand Down
17 changes: 7 additions & 10 deletions src/test/cfg/eslint.config.dump.json
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@
0
],
"@typescript-eslint/only-throw-error": [
2
0
],
"@typescript-eslint/prefer-as-const": [
0
Expand Down Expand Up @@ -969,9 +969,6 @@
"no-new-symbol": [
0
],
"no-new-wrappers": [
2
],
"no-nonoctal-decimal-escape": [
0
],
Expand Down Expand Up @@ -1056,7 +1053,7 @@
0
],
"no-undef-init": [
2
0
],
"no-underscore-dangle": [
0
Expand Down Expand Up @@ -1314,7 +1311,7 @@
0
],
"unicorn/error-message": [
2
0
],
"unicorn/escape-case": [
2
Expand All @@ -1332,7 +1329,7 @@
0
],
"unicorn/new-for-builtins": [
2
0
],
"unicorn/no-abusive-eslint-disable": [
0
Expand Down Expand Up @@ -1509,7 +1506,7 @@
2
],
"unicorn/prefer-date-now": [
2
0
],
"unicorn/prefer-default-parameters": [
2
Expand Down Expand Up @@ -1636,7 +1633,7 @@
2
],
"unicorn/require-number-to-fixed-digits-argument": [
2
0
],
"unicorn/require-post-message-target-origin": [
0
Expand All @@ -1654,7 +1651,7 @@
2
],
"unicorn/throw-new-error": [
2
0
],
"use-isnan": [
0
Expand Down
Loading

0 comments on commit 212f577

Please sign in to comment.