Skip to content

Commit bff08b2

Browse files
committed
Add package 'eslint-plugin-unused-imports'
1 parent a12c525 commit bff08b2

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

.eslintrc.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
extends: ['airbnb', 'prettier'],
3-
plugins: ['prefer-arrow', '@babel', 'react', 'prettier'],
3+
plugins: ['prefer-arrow', '@babel', 'react', 'unused-imports', 'prettier'],
44
env: {
55
es6: true,
66
browser: true,
@@ -45,6 +45,17 @@ module.exports = {
4545
classPropertiesAllowed: false,
4646
},
4747
],
48+
'no-unused-vars': 'off',
49+
'unused-imports/no-unused-imports': 'error',
50+
'unused-imports/no-unused-vars': [
51+
'error',
52+
{
53+
vars: 'all',
54+
varsIgnorePattern: '^_',
55+
args: 'after-used',
56+
argsIgnorePattern: '^_',
57+
},
58+
],
4859
'no-alert': 0,
4960
'no-console': 0,
5061
'prettier/prettier': 'error',

package-lock.json

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"eslint-plugin-prefer-arrow": "^1.2.3",
5050
"eslint-plugin-prettier": "^4.0.0",
5151
"eslint-plugin-react": "^7.29.4",
52+
"eslint-plugin-unused-imports": "^2.0.0",
5253
"eslint-webpack-plugin": "^3.1.1",
5354
"husky": "^7.0.4",
5455
"json-loader": "^0.5.7",

src/assets/js/_modules/menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock';
44
export const menu = () => {
55
const togglePanel = (c, t) => {
66
// Toggle Body Scroll
7-
// eslint-disable-next-line no-unused-vars
7+
// eslint-disable-next-line unused-imports/no-unused-vars
88
const r = jQuery('body').hasClass(c) ? enableBodyScroll(t) : disableBodyScroll(t);
99
// Add class to body
1010
jQuery('body').toggleClass(c);

0 commit comments

Comments
 (0)