1.4.1 • Published 5 years ago
eslint-config-stackr23 v1.4.1
eslint-config-stackr23
minimalistic ESLint Shareable Config
StackR23 variation of JavaScript Standard Style
Usage
installnpm install --save-dev eslint-config-stackr23 eslint-plugin-promise [eslint]
peerDependencies
/browser - eslint^5 and eslint-plugin-promise^4
/node - + eslint-plugin-import
extend eslint config
add to your
.eslintrc
file:
for web -"extends": ["stackr23/browser"]
add your overwrites
You can override settings from the shareable config by adding them directly into your .eslintrc
files `"rules" section
StackR23 customizations
based on reducment of dependencies
and different evironment setups
stackr23
for all environments
plugins
- removed standard related packages
standard-js rules just offer optional settings per "either" option ➖ eslint-config-standard ➖ eslint-plugin-standard
rules
// These rules differ from eslint-config-standard
rules: {
"no-multi-spaces": "error", // TBD
// readability and alignment for var statements
camelcase: ["error", {
ignoreDestructuring: true
}],
// Enforce camelCase
camelcase: ['error', {
ignoreDestructuring: true,
properties: 'never' // ignores properites case
}],
// We dont want unnessessary var statements to flood our script
// AND 4 space indentation perfectly aligns var and let statements
"one-var": ["error", {
"const": "never",
"var": "consecutive",
"let": "consecutive",
"separateRequires": true
}],
// obsolet due to === enforcement
// (originally, yoda-conditions are used to prevent accidental assignments)
yoda: ["error", "never"],
// enforce linebreaks for multiline array-entries
"array-element-newline": ["error", { "multiline": true }],
// enforce EOF linebreak and allow double line breaks in code
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1 }]
}
stackr23/browser
environment
- set the
sourceType
to"script"
- prevents mis-usage of imports
- changed globals to fit an web based script
plugins
- removed node-env related packages ➖ eslint-config-node ➖ eslint-config-import
stackr23/node
environment
- use
babel-eslint
as parser - set the
sourceType
to"module"
- changed globals to fit an node based modules
- process, global, module, require, dirname, filename
plugins
- ➕ eslint-plugin-import
stackr23/node
environment
- ➕
parserOptions.ecmaFeatures.jsx = true
- ➕ settings.react.version
plugin
- ➕ eslint-plugin-react
rules
- ➕ extends - "plugin:react/recommended"
TBD
- environments
stackr23/browser
stackr23/node
stackr23/react
- add rules of airbnb-base? (isolated of node bases plugin-rules)
- finetuning for special cases
- block-spacing (allow on functions and classes)
- camelcase, block-spacing.multiline,
- solve conflict of prettier spacing and custom alignment
- related with no-multi-spaces/key-spacing
- add more tests
- no duplicate rule definitions
- ...
Open Source info
MIT Licensed
Copyright
Copyright (c) Feross Aboukhadijeh.