Skip to content

Commit 9c1d6dd

Browse files
authored
chore(lint): Use shared eslint config (#2157)
1 parent fd5045f commit 9c1d6dd

29 files changed

+1258
-1148
lines changed

.eslintrc.json

Lines changed: 0 additions & 78 deletions
This file was deleted.

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

biome.json

Lines changed: 71 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.5/schema.json",
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",
@@ -14,26 +14,85 @@
1414
"linter": {
1515
"enabled": true,
1616
"rules": {
17+
"complexity": {
18+
"noUselessStringConcat": "error",
19+
"noUselessUndefined": "error",
20+
"useSimplifiedLogicExpression": "error",
21+
"useWhile": "error"
22+
},
23+
"performance": {
24+
"useTopLevelRegex": "error"
25+
},
1726
"suspicious": {
18-
"noVar": "error",
19-
"noSkippedTests": "error",
27+
"noConstantBinaryExpressions": "error",
2028
"noShadowRestrictedNames": "off",
2129
"noAssignInExpressions": "off",
22-
"noConstEnum": "off"
30+
"noConstEnum": "off",
31+
"useAwait": "error"
2332
},
2433
"style": {
34+
"noNonNullAssertion": "off",
35+
"noInferrableTypes": "error",
36+
"noNegationElse": "error",
37+
"noUnusedTemplateLiteral": "error",
2538
"noUselessElse": "error",
26-
"useTemplate": "error",
39+
"noYodaExpression": "error",
40+
"useAsConstAssertion": "error",
41+
"useCollapsedElseIf": "error",
42+
"useCollapsedIf": "error",
43+
"useConsistentArrayType": "error",
44+
"useConsistentArrowReturn": "error",
45+
"useConsistentMemberAccessibility": "error",
2746
"useConsistentObjectDefinitions": "error",
28-
"noNonNullAssertion": "off"
47+
"useConsistentTypeDefinitions": "error",
48+
"useDefaultParameterLast": "error",
49+
"useExplicitLengthCheck": "error",
50+
"useFilenamingConvention": "error",
51+
"useNumberNamespace": "error",
52+
"useNumericSeparators": "error",
53+
"useObjectSpread": "error",
54+
"useShorthandAssign": "error",
55+
"useUnifiedTypeSignatures": "error"
2956
},
30-
"nursery": {
31-
"useConsistentArrowReturn": "error"
32-
}
57+
"recommended": true
3358
}
3459
},
35-
"assist": { "actions": { "source": { "organizeImports": "on" } } },
60+
"assist": {
61+
"actions": {
62+
"source": {
63+
"organizeImports": "on"
64+
}
65+
},
66+
"enabled": true
67+
},
3668
"files": {
37-
"includes": ["**", "!maps/*.json"]
38-
}
69+
"includes": ["**", "!maps/*.json", "!maps", "!**/.*"],
70+
"ignoreUnknown": true
71+
},
72+
"overrides": [
73+
{
74+
"includes": ["**/*.{test,spec}.ts", "test/**/*.ts"],
75+
"javascript": {
76+
"globals": [
77+
"jest",
78+
"describe",
79+
"it",
80+
"beforeEach",
81+
"afterEach",
82+
"expect",
83+
"vi"
84+
]
85+
}
86+
},
87+
{
88+
"includes": ["**/*.ts", "**/*.cts", "**/*.mts", "**/*.tsx"],
89+
"linter": {
90+
"rules": {
91+
"complexity": {
92+
"useLiteralKeys": "off"
93+
}
94+
}
95+
}
96+
}
97+
]
3998
}

decode.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
21
// @ts-ignore
32
export * from "./dist/commonjs/decode.js";

decode.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
// Make exports work in Node < 12
2-
// eslint-disable-next-line no-undef, unicorn/prefer-module
32
module.exports = require("./dist/commonjs/decode.js");

escape.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
21
// @ts-ignore
32
export * from "./dist/commonjs/escape.js";

escape.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
// Make exports work in Node < 12
2-
// eslint-disable-next-line no-undef, unicorn/prefer-module
32
module.exports = require("./dist/commonjs/escape.js");

eslint.config.mjs

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import { fileURLToPath } from "node:url";
2+
import { includeIgnoreFile } from "@eslint/compat";
3+
import feedicFlatConfig from "@feedic/eslint-config";
4+
import { commonTypeScriptRules } from "@feedic/eslint-config/typescript";
5+
import { defineConfig } from "eslint/config";
6+
import eslintConfigBiome from "eslint-config-biome";
7+
import globals from "globals";
8+
import tseslint from "typescript-eslint";
9+
10+
const gitignorePath = fileURLToPath(new URL(".gitignore", import.meta.url));
11+
12+
export default defineConfig([
13+
includeIgnoreFile(gitignorePath),
14+
{
15+
linterOptions: {
16+
reportUnusedDisableDirectives: "error",
17+
},
18+
},
19+
{
20+
ignores: ["eslint.config.{js,cjs,mjs}"],
21+
},
22+
...feedicFlatConfig,
23+
{
24+
rules: {
25+
"capitalized-comments": [
26+
2,
27+
"always",
28+
{
29+
ignorePattern: "biome",
30+
},
31+
],
32+
"n/no-unpublished-import": 0,
33+
},
34+
},
35+
{
36+
files: ["**/*.ts"],
37+
extends: [...tseslint.configs.recommended],
38+
languageOptions: {
39+
parser: tseslint.parser,
40+
parserOptions: {
41+
sourceType: "module",
42+
project: "./tsconfig.json",
43+
},
44+
},
45+
rules: {
46+
...commonTypeScriptRules,
47+
},
48+
},
49+
{
50+
files: ["**/*.spec.ts"],
51+
rules: {
52+
"n/no-unsupported-features/es-builtins": 0,
53+
"n/no-unsupported-features/node-builtins": 0,
54+
},
55+
},
56+
{
57+
files: ["{decode,escape}.js"],
58+
languageOptions: {
59+
globals: globals.commonjs,
60+
sourceType: "commonjs",
61+
},
62+
rules: {
63+
"n/no-missing-require": 0,
64+
},
65+
},
66+
{
67+
files: ["scripts/**"],
68+
rules: {
69+
"n/no-unsupported-features/es-builtins": 0,
70+
"n/no-unsupported-features/node-builtins": 0,
71+
},
72+
},
73+
{
74+
files: ["src/generated/**"],
75+
rules: {
76+
"multiline-comment-style": 0,
77+
"capitalized-comments": 0,
78+
"unicorn/escape-case": 0,
79+
"unicorn/no-hex-escape": 0,
80+
"unicorn/numeric-separators-style": 0,
81+
"unicorn/prefer-spread": 0,
82+
},
83+
},
84+
eslintConfigBiome,
85+
]);

0 commit comments

Comments
 (0)