From cc2294f2ef39b31c7f67ae6f1a9d374f68980434 Mon Sep 17 00:00:00 2001 From: Wes Date: Thu, 29 Aug 2024 09:01:14 -0700 Subject: [PATCH] chore(lint): centralize node linting rules (#2528) Fixes #2522 --- .npmrc | 1 + biome.json | 41 ++++++++++++++++++++++++++++++++++++ extensions/vscode/biome.json | 36 +------------------------------ frontend/biome.json | 36 +------------------------------ 4 files changed, 44 insertions(+), 70 deletions(-) create mode 100644 biome.json diff --git a/.npmrc b/.npmrc index b6f27f1359..2878da16d4 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ engine-strict=true +shamefully-hoist=true diff --git a/biome.json b/biome.json new file mode 100644 index 0000000000..c428d28f7d --- /dev/null +++ b/biome.json @@ -0,0 +1,41 @@ +{ + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "organizeImports": { + "enabled": true, + "ignore": ["node_modules", "dist", "protos"] + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "a11y": { + "useKeyWithClickEvents": "off" + }, + "correctness": { + "useExhaustiveDependencies": "off" + }, + "suspicious": { + "noArrayIndexKey": "off" + } + } + }, + "formatter": { + "indentStyle": "space", + "indentWidth": 2, + "lineWidth": 160 + }, + "javascript": { + "formatter": { + "semicolons": "asNeeded", + "indentStyle": "space", + "quoteStyle": "single", + "jsxQuoteStyle": "single" + } + }, + "json": { + "formatter": { + "indentStyle": "space", + "indentWidth": 2 + } + } +} diff --git a/extensions/vscode/biome.json b/extensions/vscode/biome.json index 73313efc79..819a57ef06 100644 --- a/extensions/vscode/biome.json +++ b/extensions/vscode/biome.json @@ -1,45 +1,11 @@ { - "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "organizeImports": { - "enabled": true, - "ignore": ["./node_modules", "./dist"] - }, + "extends": ["../../biome.json"], "linter": { - "enabled": true, - "rules": { - "recommended": true, - "a11y": { - "useKeyWithClickEvents": "off" - }, - "correctness": { - "useExhaustiveDependencies": "off" - }, - "suspicious": { - "noArrayIndexKey": "off" - } - }, "include": ["src/**/*.ts"], "ignore": ["./node_modules", "./dist"] }, "formatter": { - "indentStyle": "space", - "indentWidth": 2, - "lineWidth": 160, "include": ["src/**/*.ts"], "ignore": ["./node_modules", "./dist"] - }, - "javascript": { - "formatter": { - "semicolons": "asNeeded", - "indentStyle": "space", - "quoteStyle": "single", - "jsxQuoteStyle": "single" - } - }, - "json": { - "formatter": { - "indentStyle": "space", - "indentWidth": 2 - } } } diff --git a/frontend/biome.json b/frontend/biome.json index ab7cde5926..a692a2c941 100644 --- a/frontend/biome.json +++ b/frontend/biome.json @@ -1,45 +1,11 @@ { - "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "organizeImports": { - "enabled": true, - "ignore": ["./node_modules", "./dist", "./src/protos"] - }, + "extends": ["../biome.json"], "linter": { - "enabled": true, - "rules": { - "recommended": true, - "a11y": { - "useKeyWithClickEvents": "off" - }, - "correctness": { - "useExhaustiveDependencies": "off" - }, - "suspicious": { - "noArrayIndexKey": "off" - } - }, "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx", "src/**/*.cjs", "src/**/*.mjs", "tests/**/*.ts"], "ignore": ["./node_modules", "./dist", "./src/protos"] }, "formatter": { - "indentStyle": "space", - "indentWidth": 2, - "lineWidth": 160, "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx", "src/**/*.cjs", "src/**/*.mjs", "tests/**/*.ts"], "ignore": ["./node_modules", "./dist", "./src/protos"] - }, - "javascript": { - "formatter": { - "semicolons": "asNeeded", - "indentStyle": "space", - "quoteStyle": "single", - "jsxQuoteStyle": "single" - } - }, - "json": { - "formatter": { - "indentStyle": "space", - "indentWidth": 2 - } } }