Write bulletproof JavaScript like a pro! 😎
mocha
environment preset, max-nested-callbacks
now allows up to 6 nested callbacksreact/forbid-dom-props
is now enabled and prevents you from using plain DOM nodes with either id
or style
props (React components are not affected by this rule)This major upgrade brings all the bundled plugins up to date with new rules and updated configuration, so we can all enjoy even more thorough code checks on our projects! 🎨
Also, the node
environment preset now includes eslint-plugin-node
for enhanced Node.js-related code analysis, like unsupported syntax/builtins/globals on specific Node.js runtimes or warnings on deprecated API usage.
eslint-plugin-mocha
plugin have been increased from warn
to error
leveleslint-plugin-react
to latest and greatest version and added some new rules with error
leveleslint-plugin-flowtype
to latest greatest version which contained some breaking parsing changeseslint-plugin-node
plugin to the node
environment preset 🎉 💪npm i -D eslint@latest @strv/eslint-plugin-javascript@latest
In case the above does not work (you get errors about unknown rules being used or "cannot find module x") you might have to drop the whole ruleset from your project first:
npm remove eslint @strv/eslint-config-javascript
rm -rf node_modules
npm i && npm i -D eslint@latest @strv/eslint-plugin-javascript@latest
TypeScript ruleset is now available! 🎉 Still somewhat experimental - please report any issues or false-positives that you find in your code.
id-length
: Now allows up to 30 characters max (up from 25) and allows the following single-character identifiers: i
(index), R
(Ramda 😍), _
(lodash 💩), $
(jQuery & family 🤮)@strv/javascript/environments/mocha/recommended
environment has been added for Mocha test files 🎨
See the configuration file linked above for details about which rules have been enabled. All rules will only report warning
so adding this ruleset will not break your CI pipeline.
⚠️ Some rules from this ruleset will be bumped to
error
level on the next semver-major release of this package.
import/extensions
have been removed as the rule now automatically supports .js, .mjs and .jsx files@petrhanak 🍻
comma-dangle
is now enforced for multiline function parameters (cffa40df10f4db719c264980aa13b9c4ce2288fc)ecmaVersion
to 2017
in react ruleset (#25 🍻 @petrhanak)console.log()
usage (#26 🍻 @petrhanak)array-bracket-newline
to require consistent array bracket placement (6721fd4b069f1d01b69ae9d26ed53d923c0cddf9)lines-between-class-members
to require empty lines between class members (52a2dd048d4a0295de40ac5c82612c86ec500b62)multiline-comment-style
to prefer separate comment lines for multiline comment blocks (77fe9678b20da7fc1cea6cd91a3713686a8b7d88)