Created
November 14, 2020 23:37
-
-
Save jakecobley/94262dfc1be3f0131bac2e320bb91c10 to your computer and use it in GitHub Desktop.
ESLint configuration extending Airbnb's configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# Node | |
################################################################################ | |
node_modules | |
################################################################################ | |
# Compiled Directories & Files | |
################################################################################ | |
dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
root: true, | |
env: { | |
browser: true, | |
}, | |
extends: [ | |
// @see https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base | |
"airbnb-base", | |
], | |
rules: { | |
// Disallow the use of console. | |
// @see https://eslint.org/docs/rules/no-console | |
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", | |
// Disallow the use of debugger. | |
// @see https://eslint.org/docs/rules/no-debugger | |
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", | |
// ///////////////////////////////////////////////////////////////////////// | |
// `airbnb-base`: Overwrites | |
// @see https://github.com/vuejs/eslint-config-airbnb, | |
// https://github.com/airbnb/javascript | |
// ///////////////////////////////////////////////////////////////////////// | |
// Disable `import/no-unresolved`, a peer dependency of `airbnb-base`. | |
// @see https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md | |
"import/no-unresolved": "off", | |
// Enforce maximum line length. | |
// @see https://eslint.org/docs/rules/max-len | |
"max-len": ["error", 120, 2, { | |
ignoreUrls: true, | |
ignoreComments: false, | |
ignoreRegExpLiterals: true, | |
ignoreStrings: true, | |
ignoreTemplateLiterals: true, | |
}], | |
// Enforce the consistent use of either backticks, double, or single quotes. | |
// @see https://eslint.org/docs/rules/quotes, | |
// https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js | |
quotes: ["error", "double"], | |
}, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"private": true, | |
"scripts": { | |
"lint": "eslint source --ext js --fix", | |
}, | |
"dependencies": { | |
}, | |
"devDependencies": { | |
"eslint": "^7.9.0", | |
"eslint-config-airbnb-base": "^14.2.0", | |
"eslint-plugin-import": "^2.22.0", | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment