Skip to content

Commit

Permalink
eslint to fix unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
fstasi committed Jun 22, 2021
1 parent 0592199 commit e6cbefb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 10 deletions.
36 changes: 26 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
module.exports = {
ignorePatterns: [
'node_modules/*',
'/*',
'!arduino-ide-extension',
'arduino-ide-extension/*',
'!arduino-ide-extension/src',
'arduino-ide-extension/src/node/cli-protocol',
],
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
Expand All @@ -15,6 +7,20 @@ module.exports = {
jsx: true, // Allows for the parsing of JSX
},
},
ignorePatterns: [
'node_modules/*',
'**/node_modules/*',
'.node_modules/*',
'.github/*',
'.browser_modules/*',
'docs/*',
'scripts/*',
'electron/*',
'electron-app/*',
'browser-app/*',
'plugins/*',
'arduino-ide-extension/src/node/cli-protocol',
],
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
Expand All @@ -27,14 +33,24 @@ module.exports = {
'plugin:prettier/recommended',
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
],
plugins: ['prettier'],
root: true,
plugins: ['prettier', 'unused-imports'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-empty-interface': 'warn',
'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'react/display-name': 'warn',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'off',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-unused-imports": "^1.1.1",
"husky": "^6.0.0",
"lerna": "^3.20.2",
"lint-staged": "^11.0.0",
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7343,6 +7343,18 @@ eslint-plugin-react@^7.24.0:
resolve "^2.0.0-next.3"
string.prototype.matchall "^4.0.5"

eslint-plugin-unused-imports@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-1.1.1.tgz#a5433f8b394461201129a246d8d92d9613e69597"
integrity sha512-EApvRx9Q3XQI96Tg7xPPqY6OuOy95wWMXAtc8RrwdIRk9bv8vkJKwOVoE4HeWJOQhHeHcI8lUbOqmup/PxjfOw==
dependencies:
eslint-rule-composer "^0.3.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@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"
Expand Down

0 comments on commit e6cbefb

Please sign in to comment.