fix: remove unused imports (#8613)

This commit is contained in:
jrandolf 2022-07-01 16:00:03 +02:00 committed by GitHub
parent 8cf10fb7b9
commit 0cf4832878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 3 deletions

View File

@ -1,6 +1,6 @@
assets/ assets/
build/ build/
coverage/ coverage/
lib/ lib
tsconfig.tsbuildinfo tsconfig.tsbuildinfo
vendor/ vendor/

17
.eslintrc.types.cjs Normal file
View File

@ -0,0 +1,17 @@
module.exports = {
plugins: ['unused-imports'],
parser: '@typescript-eslint/parser',
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
},
};

46
package-lock.json generated
View File

@ -57,6 +57,7 @@
"eslint-plugin-mocha": "10.0.5", "eslint-plugin-mocha": "10.0.5",
"eslint-plugin-prettier": "4.0.0", "eslint-plugin-prettier": "4.0.0",
"eslint-plugin-tsdoc": "0.2.16", "eslint-plugin-tsdoc": "0.2.16",
"eslint-plugin-unused-imports": "^2.0.0",
"esprima": "4.0.1", "esprima": "4.0.1",
"expect": "25.2.7", "expect": "25.2.7",
"gts": "3.1.0", "gts": "3.1.0",
@ -3150,6 +3151,36 @@
"@microsoft/tsdoc-config": "0.16.1" "@microsoft/tsdoc-config": "0.16.1"
} }
}, },
"node_modules/eslint-plugin-unused-imports": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-2.0.0.tgz",
"integrity": "sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==",
"dev": true,
"dependencies": {
"eslint-rule-composer": "^0.3.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^5.0.0",
"eslint": "^8.0.0"
},
"peerDependenciesMeta": {
"@typescript-eslint/eslint-plugin": {
"optional": true
}
}
},
"node_modules/eslint-rule-composer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz",
"integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==",
"dev": true,
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/eslint-rule-docs": { "node_modules/eslint-rule-docs": {
"version": "1.1.235", "version": "1.1.235",
"resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.235.tgz", "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.235.tgz",
@ -10674,6 +10705,21 @@
"@microsoft/tsdoc-config": "0.16.1" "@microsoft/tsdoc-config": "0.16.1"
} }
}, },
"eslint-plugin-unused-imports": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-2.0.0.tgz",
"integrity": "sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==",
"dev": true,
"requires": {
"eslint-rule-composer": "^0.3.0"
}
},
"eslint-rule-composer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz",
"integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==",
"dev": true
},
"eslint-rule-docs": { "eslint-rule-docs": {
"version": "1.1.235", "version": "1.1.235",
"resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.235.tgz", "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.235.tgz",

View File

@ -40,12 +40,12 @@
"lint:prettier": "prettier --check .", "lint:prettier": "prettier --check .",
"lint:eslint": "([ \"$CI\" = true ] && eslint --ext js --ext ts --quiet -f codeframe . || eslint --ext js --ext ts .)", "lint:eslint": "([ \"$CI\" = true ] && eslint --ext js --ext ts --quiet -f codeframe . || eslint --ext js --ext ts .)",
"install": "node install.js", "install": "node install.js",
"generate:types": "node utils/export_all.js && api-extractor run --local --verbose", "generate:types": "node utils/export_all.js && api-extractor run --local --verbose && eslint --ext ts --no-ignore --no-eslintrc -c .eslintrc.types.cjs --fix lib/types.d.ts",
"generate:markdown": "ts-node -O '{\"module\":\"commonjs\"}' utils/generate_docs.ts && prettier --ignore-path none --write docs", "generate:markdown": "ts-node -O '{\"module\":\"commonjs\"}' utils/generate_docs.ts && prettier --ignore-path none --write docs",
"generate:esm-package-json": "echo '{\"type\": \"module\"}' > lib/esm/package.json", "generate:esm-package-json": "echo '{\"type\": \"module\"}' > lib/esm/package.json",
"format": "run-s format:*", "format": "run-s format:*",
"format:prettier": "prettier --write .", "format:prettier": "prettier --write .",
"format:eslint": "eslint --ext js --ext ts --fix ..", "format:eslint": "eslint --ext js --ext ts --fix .",
"docs": "run-s build generate:markdown", "docs": "run-s build generate:markdown",
"debug": "npm run build:test && mocha --inspect-brk", "debug": "npm run build:test && mocha --inspect-brk",
"commitlint": "commitlint --from=HEAD~1", "commitlint": "commitlint --from=HEAD~1",
@ -114,6 +114,7 @@
"eslint-plugin-mocha": "10.0.5", "eslint-plugin-mocha": "10.0.5",
"eslint-plugin-prettier": "4.0.0", "eslint-plugin-prettier": "4.0.0",
"eslint-plugin-tsdoc": "0.2.16", "eslint-plugin-tsdoc": "0.2.16",
"eslint-plugin-unused-imports": "2.0.0",
"esprima": "4.0.1", "esprima": "4.0.1",
"expect": "25.2.7", "expect": "25.2.7",
"gts": "3.1.0", "gts": "3.1.0",