Releases: strvcom/eslint-config-javascript
7.7.0
New rules
- react/jsx-curly-brace-presence: Prohibits superfluous literal expressions in JSX elements
- flowtype/no-unused-expressions: Extends the ESLint builtin rule of the same name and avoids marking type-only expressions as not being used
Changes
- newline-per-chained-call: Moved to coding-styles/fixable
- no-extra-parens: Extra parens are now allowed around assignments in return expressions
- template-tag-spacing: Now disallows spaces between the tag function and the tag string
- import/no-anonymous-default-export: Literal objects and arrays are now allowed to be the default export value without assigning the value to a const first
7.6.0
Changes
- Upgraded ESLint to 4.6.0 (you may have to drop your node_modules folder to upgrade properly)
- config glob will now match the config folder even if in subdirectories (ie src/config, lib/config etc.)
- Updated package.json metadata, enhanced README and tutorials
7.5.0
This release contains major new features! See the notes below for detailed info.
New features
-
Cool new Flow ruleset! (#22 🎉 thanks @arnostpleskot)
@strv/javascript/environments/flow/recommended & @strv/javascript/coding-styles/flow
-
Cool new React accessibility ruleset! (#20 🎉 thanks @petrhanak)
@strv/javascript/environments/react/accessibility and also included in the React ruleset 💪
Changes
react/no-unused-prop-types
: No longer validates shape props (#21)
7.4.0
New rules
react/no-typos
: Prevents common typos on React componentsreact/no-unused-state
: Prevent definition of unused state fields (currently missing docs)
Changes
- ESLint 4.5 is now required:
npm i -D eslint@^4.5
to upgrade your version - eslint-plugin-react was upgraded. If you get warnings about unknown rules, just drop your node_modules and install all deps again.
- Added new ruleset for Node.js 8.3 release: environments/nodejs/v8-3: This ruleset enables object rest-spread syntax introduced in v8 engine 6.0
- For files in
config/
orconfiguration/
directories, the ruleno-process-env
has been turned off - For files matching patterns
test/**
,packages/*/test/**/*.test.*
,packages/*/test/**/*.spec.*
, themocha: true
environment is enabled andfunc-names
rule is turned offThese settings were previously usually configured on a custom, per-project .eslintrc.js. ESLint introduced an option to override some rules based on matching path patterns so these rules can now be centrally overridden.
7.3.0
Changes
- Added complete support for Mocha's BDD interface by configuring
no-restricted-properties
rule to also flagcontext.only()
,context.skip()
,specify.only()
andspecify.skip()
calls (thanks @ozivnustka)
7.2.0
Changes
- Add autofix configuration tutorial for WebStorm (thanks @polacekpavel ❤️)
- Upgrade ESLint to 4.2.0
- Upgrade eslint-config-import to 2.7.0
- Upgrade eslint-plugin-react to 7.1.0
New rules
- react/jsx-closing-tag-location:
warn
- react/default-props-match-prop-types:
warn
- react/no-redundant-should-component-update:
warn
- getter-return:
error
Changed rules
- multiline-ternary: Now the ternary must either be completely on a single line or each part must be on its own line
- no-sync: Now you can
require()
modules anywhere at the module scope (in other words, as long as ESLint can clearly detect that therequire
call is executed as part of the module loading process it will not complain)
7.1.0
Changes
- Added
@strv/javascript/environments/nodejs/v8
config style for Node.js 8.0 release line
7.0.0
This release adds new rules from ESLint 4 and therefore requires that ESLint version.
New rules:
object-curly-newline
: set toconsistent: true
padding-line-between-statements
: Used as a replacement for the now-deprecatedlines-around-directive
(requires a newline after'use strict'
semi-style
: Configures semicolon placement to being at the beginning of statements. This makes little difference for semi-less coding style; however, you may wish to reconfigure this rule if you have a different setting for thesemi
rule.switch-colon-spacing
: Requires spaces after the colon in aswitch
'scase
and disallows spaces before the colon, iecase test: fn()
for-direction
: Infor
loops, require the statement which is executed on each iteration to move toward the terminating condition. See the examples if this sounds incomprehensible. 🙂import/no-anonymous-default-export
: Encourages ES2015's default exports to have a name. The reasoning for this is explained in the rule's documentation.react/no-will-update-set-state
: Do not allow usingsetState()
insidecomponentWillUpdate()
.
Changes
react/no-deprecated
: Lowered towarn
instead oferror
. This should make it easier to work with React when migrating to a higher version. 💪- the
environments/react/v15
ruleset now defines the target React version as15.5
instead of15
. This will most likely cause some warnings to appear due to React preparing you for thev16
release.
6.6.0
This release adds ESLint 4.0 compatibility to partially avoid warnings on npm install
.
Some rules have also been removed as they have been deprecated. It is recommended that you upgrade to 7.0 release
Removed rules:
These rules are removed from this release, but an alternative may have been added back in the 7.0 release of this ruleset.
6.5.0
New rules
nonblock-statement-body-position
: (warn) Enforce the location of single-line statementsNot really used because
curly
rule does not allow this kind of coding style at all. Enabled in case someone decides thatcurly
is not good enough for them 😱template-tag-spacing
: (warn) Require spacing between template tags and their literalsno-compare-neg-zero
: (error) Disallow comparing against -0react/forbid-foreign-prop-types
: (warn) This rule forbids using another component's prop types unless they are explicitly imported/exportedreact/void-dom-elements-no-children
: (error) Prevent void DOM elements (e.g.<img />
,<br />
) from receiving children
Rule changes
no-use-before-define
: Classes are now also exempted from this rule, thus allowing them to be referenced before they are defined
Other changes
- Allow .js files to include JSX components (@arnostpleskot)