Skip to content

Commit

Permalink
feat: disable eslint-plugin-unused-imports in favor of biome (experim…
Browse files Browse the repository at this point in the history
…ental)
  • Loading branch information
kirillgroshkov committed Aug 10, 2024
1 parent a0ef5a1 commit fa21aa4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 33 deletions.
11 changes: 6 additions & 5 deletions cfg/eslint-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,12 @@ module.exports = {
argsIgnorePattern: '^_',
},
],
'unused-imports/no-unused-imports': 2,
'unused-imports/no-unused-vars': [
2,
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
// unused-imports/* rules are replaced by biome
// 'unused-imports/no-unused-imports': 2,
// 'unused-imports/no-unused-vars': [
// 2,
// { vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
// ],
'@typescript-eslint/no-duplicate-enum-values': 2,
'@typescript-eslint/no-redundant-type-constituents': 0, // `'a' | string` is still useful for DX
'@typescript-eslint/no-empty-function': 0,
Expand Down
2 changes: 1 addition & 1 deletion cfg/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function getConfig() {
plugins: {
'@typescript-eslint': tseslint.plugin,
'import-x': require('eslint-plugin-import-x'),
'unused-imports': require('eslint-plugin-unused-imports'),
// 'unused-imports': require('eslint-plugin-unused-imports'), // disabled in favor of biome rules
'simple-import-sort': require('eslint-plugin-simple-import-sort'),
jsdoc: require('eslint-plugin-jsdoc'),
...(hasJest ? { jest: require('eslint-plugin-jest') } : {}),
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"eslint-plugin-jsdoc": "^50.0.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unicorn": "^55.0.0",
"eslint-plugin-unused-imports": "4.0.1",
"eslint-plugin-vue": "^9.0.0",
"expect-type": "^0.19.0",
"globals": "^15.8.0",
Expand Down
4 changes: 3 additions & 1 deletion src/lint.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ function runActionLint(): void {

export function runBiome(verbose = false, fix = true): void {
if (!fs.existsSync(`node_modules/@biomejs/biome`)) {
if (verbose) console.log(`biome is not installed (checked in node_modules/@biomejs), skipping`)
if (verbose) {
console.log(`biome is not installed (checked in node_modules/@biomejs/biome), skipping`)
}
return
}

Expand Down
13 changes: 0 additions & 13 deletions src/test/cfg/eslint.config.dump.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"unicorn:eslint-plugin-unicorn@55.0.0",
"vue:eslint-plugin-vue@9.27.0",
"import-x",
"unused-imports",
"simple-import-sort:eslint-plugin-simple-import-sort@12.1.1",
"jsdoc",
"jest:eslint-plugin-jest@28.8.0"
Expand Down Expand Up @@ -1681,18 +1680,6 @@
"unicorn/throw-new-error": [
2
],
"unused-imports/no-unused-imports": [
2
],
"unused-imports/no-unused-vars": [
2,
{
"args": "after-used",
"argsIgnorePattern": "^_",
"vars": "all",
"varsIgnorePattern": "^_"
}
],
"use-isnan": [
2
],
Expand Down
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2179,13 +2179,6 @@ eslint-plugin-unicorn@^55.0.0:
semver "^7.6.1"
strip-indent "^3.0.0"

eslint-plugin-unused-imports@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.0.1.tgz#b78916ecb82ae6d0f54efb33879c6c7ecb52f080"
integrity sha512-rax76s05z64uQgG9YXsWFmXrgjkaK79AvfeAWiSxhPP6RVGxeRaj4+2u+wxxu/mDy2pmJoOy1QTOEALMia2xGQ==
dependencies:
eslint-rule-composer "^0.3.0"

eslint-plugin-vue@^9.0.0:
version "9.27.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-9.27.0.tgz#c22dae704a03d9ecefa81364ff89f60ce0481f94"
Expand All @@ -2200,11 +2193,6 @@ eslint-plugin-vue@^9.0.0:
vue-eslint-parser "^9.4.3"
xml-name-validator "^4.0.0"

eslint-rule-composer@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9"
integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==

eslint-scope@^7.1.1:
version "7.2.2"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f"
Expand Down

0 comments on commit fa21aa4

Please sign in to comment.