Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e6cbefb

Browse files
committed
eslint to fix unused imports
1 parent 0592199 commit e6cbefb

File tree

3 files changed

+39
-10
lines changed

3 files changed

+39
-10
lines changed

‎.eslintrc.js‎

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
module.exports = {
2-
ignorePatterns: [
3-
'node_modules/*',
4-
'/*',
5-
'!arduino-ide-extension',
6-
'arduino-ide-extension/*',
7-
'!arduino-ide-extension/src',
8-
'arduino-ide-extension/src/node/cli-protocol',
9-
],
102
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
113
parserOptions: {
124
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
@@ -15,6 +7,20 @@ module.exports = {
157
jsx: true, // Allows for the parsing of JSX
168
},
179
},
10+
ignorePatterns: [
11+
'node_modules/*',
12+
'**/node_modules/*',
13+
'.node_modules/*',
14+
'.github/*',
15+
'.browser_modules/*',
16+
'docs/*',
17+
'scripts/*',
18+
'electron/*',
19+
'electron-app/*',
20+
'browser-app/*',
21+
'plugins/*',
22+
'arduino-ide-extension/src/node/cli-protocol',
23+
],
1824
settings: {
1925
react: {
2026
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
@@ -27,14 +33,24 @@ module.exports = {
2733
'plugin:prettier/recommended',
2834
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
2935
],
30-
plugins: ['prettier'],
31-
root: true,
36+
plugins: ['prettier', 'unused-imports'],
3237
rules: {
3338
'@typescript-eslint/no-unused-expressions': 'off',
3439
'@typescript-eslint/no-namespace': 'off',
3540
'@typescript-eslint/no-var-requires': 'off',
3641
'@typescript-eslint/no-empty-function': 'warn',
3742
'@typescript-eslint/no-empty-interface': 'warn',
43+
'no-unused-vars': 'off',
44+
'unused-imports/no-unused-imports': 'error',
45+
'unused-imports/no-unused-vars': [
46+
'warn',
47+
{
48+
vars: 'all',
49+
varsIgnorePattern: '^_',
50+
args: 'after-used',
51+
argsIgnorePattern: '^_',
52+
},
53+
],
3854
'react/display-name': 'warn',
3955
eqeqeq: ['error', 'smart'],
4056
'guard-for-in': 'off',

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"eslint-plugin-prettier": "^3.4.0",
2020
"eslint-plugin-react": "^7.24.0",
2121
"eslint-plugin-react-hooks": "^4.2.0",
22+
"eslint-plugin-unused-imports": "^1.1.1",
2223
"husky": "^6.0.0",
2324
"lerna": "^3.20.2",
2425
"lint-staged": "^11.0.0",

‎yarn.lock‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7343,6 +7343,18 @@ eslint-plugin-react@^7.24.0:
73437343
resolve "^2.0.0-next.3"
73447344
string.prototype.matchall "^4.0.5"
73457345

7346+
eslint-plugin-unused-imports@^1.1.1:
7347+
version "1.1.1"
7348+
resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-1.1.1.tgz#a5433f8b394461201129a246d8d92d9613e69597"
7349+
integrity sha512-EApvRx9Q3XQI96Tg7xPPqY6OuOy95wWMXAtc8RrwdIRk9bv8vkJKwOVoE4HeWJOQhHeHcI8lUbOqmup/PxjfOw==
7350+
dependencies:
7351+
eslint-rule-composer "^0.3.0"
7352+
7353+
eslint-rule-composer@^0.3.0:
7354+
version "0.3.0"
7355+
resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9"
7356+
integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==
7357+
73467358
eslint-scope@^4.0.3:
73477359
version "4.0.3"
73487360
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /