Skip to content

Instantly share code, notes, and snippets.

@jakecobley
Created November 14, 2020 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakecobley/94262dfc1be3f0131bac2e320bb91c10 to your computer and use it in GitHub Desktop.
Save jakecobley/94262dfc1be3f0131bac2e320bb91c10 to your computer and use it in GitHub Desktop.
ESLint configuration extending Airbnb's configuration.
################################################################################
# Node
################################################################################
node_modules
################################################################################
# Compiled Directories & Files
################################################################################
dist
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"],
},
};
{
"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