All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
- Internal changes (incremented dependency versions)
standard
just turned 10.0.0! 🎉
As with every new major release, there are lots of new rules in 10.0.0 designed to help catch bugs and make programmer intent more explicit.
standard
is more popular than ever – 330,000 downloads per month! It's even
more popular – 670,000 downloads per month – if you include the
shareable ESLint config
that we also publish.
The most important change in 10.0.0 is that using deprecated Node.js APIs is now considered an error. It's finally time to update those dusty old APIs!
Deprecated APIs are problematic because they may print warning messages in the console in recent versions of Node.js. This often confuses users and leads to unnecessary support tickets for project maintainers.
Some deprecated APIs are even insecure (or at least prone to incorrect usage) which
can have serious security implications. For that reason, standard
now considers
usage of Buffer(num)
to be an error, since this function returns uninitialized
program memory which could contain confidential information like passwords or keys.
Instead of Buffer(num)
, consider using Buffer.alloc(num)
or Buffer.from(obj)
which make the programmer's intent clearer. These functions exist in all currently
supported versions of Node.js, including Node.js 4.x. For more background,
see this Node.js issue.
We also improved some rules to support common patterns in code bases that use React, JSX, and Flow.
When you upgrade, consider running standard --fix
to automatically fix some of
the issues caught by this new version.
- Update ESLint from 3.15.x to 3.19.x.
- Node.js API: Add
standard.lintTextSync
method
(Estimated % of affected standard users, based on test suite in parens)
- Disallow using deprecated Node.js APIs (node/no-deprecated-api) #693 (13%)
- Ensures that code always runs without warnings on the latest versions of Node.js
- Ensures that safe Buffer methods (
Buffer.from()
,Buffer.alloc()
) are used instead ofBuffer()
- Enforce callbacks always called with Node.js-style error first (standard/no-callback-literal) #623 (3%)
- Functions named
callback
orcb
must be invoked withnull
,undefined
, or anError
as the first argument - Disallows using a string instead of an
Error
object - Disallows confusing callbacks that do not follow the standard Node.js pattern
- Functions named
- Disallow any imports that come after non-import statements (import/first) #806 (1%)
- Disallow unnecessary return await (no-return-await) #695 (0%)
- Disallow comma-dangle in functions (comma-dangle) #787 (0%)
- Disallow repeated exports of names or defaults (import/export) #806 (0%)
- Disallow import of modules using absolute paths (import/no-absolute-path) #806 (0%)
- Disallow Webpack loader syntax in imports (import/no-webpack-loader-syntax) #806 (0%)
- Disallow comparing against -0 (no-compare-neg-zero) #812 (0%)
- Relax rule: allow using
...rest
to omit properties from an object (no-unused-vars) #800- This is a common and useful pattern in React/JSX apps!
- Relax rule: allow Flow
import type
statements (import/no-duplicates) #599- These are no longer considered to be "duplicate imports"
- Relax rule: Treat
process.exit()
the same asthrow
in code path analysis (node/process-exit-as-throw) #699- Makes certain other rules work better and give fewer false positives
- Relax rule: allow Unnecessary Labels (no-extra-label)
- Redundant, since "no-labels" is already enabled, which is more restrictive
- Relax rule: Allow tagged template string expressions (no-unused-expressions) #822
- Relax rule: Allow mixing basic operators without parens (no-mixed-operators) #816
- Specifically, these operators:
+
,-
,*
,/
,%
, and**
- Specifically, these operators:
It's time for a new major version of standard
! As usual, this release contains a
bunch of awesomeness to help you keep your code in tip-top shape!
We've added several new rules designed to catch potential programmer errors (i.e. bugs), as well as rules to make programmer intent more explicit in certain circumstances.
This release continues our trend of tightening up rules so that, wherever possible, there's one "right" way to do things. This design goal is intended to reduce the time that teams and maintainers spend giving code review feedback in pull requests.
When you upgrade, consider running standard --fix
to automatically fix some of the
errors caught by the new rules in this version.
Note: If you use the Chai test framework, you will need to make some changes to your tests to improve their robustness. Read about the changes you need to make.
- Update ESLint from 3.10.x to 3.15.x
- 3 additional rules are now fixable with
standard --fix
(Estimated % of affected standard users, based on test suite in parens)
- Disallow mixing different operators without parens (no-mixed-operators) #566 (5%)
- Enforce 1 newline at end of file (previously 1 or 2 were ok) (no-multiple-empty-lines) #733 (3%)
- Disallow Unused Expressions (no-unused-expressions) #690 (3%)
- Note: this affects users of the Chai test framework. Read about the changes you need to make.
- Disallow redundant return statements (no-useless-return) #694 (1%)
- Disallow Incorrect Early Use (no-use-before-define) #636 (0%)
- Enforce that Promise rejections are passed an Error object as a reason (prefer-promise-reject-errors) #777 (0%)
- Enforce comparing
typeof
expressions against string literals (valid-typeof) #629 (0%) - Enforce spacing around * in generator functions (generator-star-spacing) #724 (0%)
- Disallow Unnecessary Labels (no-extra-label) #736 (0%)
- Disallow spacing between template tags and their literals (template-tag-spacing) #755 (0%)
- Disallow padding within switch statements and classes (padded-blocks) #610 (0%)
- Enforce that Symbols are passed a description (symbol-description) #630 (0%)
- Relax rule: allow TypeScript Triple-Slash Directives (spaced-comment) #660
- Relax rule: allow Flow Comments (spaced-comment) #661
- Update ESLint from 3.8.x to 3.10.x
- 3 additional rules are now fixable with
standard --fix
- Update ESLint from 3.7.x to 3.8.x
- 2 additional rules are now fixable with
standard --fix
- Update ESLint from 3.6.x to 3.7.x
- 5 additional rules are now fixable with
standard --fix
- Use more conservative semver ranges #654
The last release (8.2.0
) added ES7 support. This release (8.3.0
) adds ES8
support ...just 3 days later!
This release should eliminate the need to specify babel-eslint
as a custom
parser, since standard
can now parse ES8 (i.e. ES2017) syntax out of the box.
That means async
and await
will just work.
- Support ES8 (i.e. ES2017) syntax.
For many users, this release should eliminate the need to specify babel-eslint
as
a custom parser, since standard
can now parse ES7 (i.e. ES2016) syntax out of the
box.
- Support ES7 (i.e. ES2016) syntax.
- Update ESLint from 3.5.x to 3.6.x
- 4 additional rules are now fixable with
standard --fix
- Update ESLint from 3.3.x to 3.5.x
- Around 10 additional rules are now fixable with
standard --fix
This release contains a bunch of goodies, including new rules that catch potential programmer errors (i.e. bugs) and enforce additional code consistency.
However, the best feature is surely the new --fix
command line flag to
automatically fix problems. If you ever used
standard-format
and ran into issues with the lack of ES2015+ support, you'll be happy about
--fix
.
standard --fix
is built into standard
v8.0.0 for maximum convenience, it
supports ES2015, and it's lightweight (no additional dependencies since it's part
of ESLint which powers standard
). Lots of problems are already fixable, and more
are getting added with each ESLint release.
standard
also outputs a message ("Run standard --fix
to automatically fix
some problems.") when it detects problems that can be fixed automatically so you
can save time!
With standard
v8.0.0, we are also dropping support for Node.js versions prior to
v4. Node.js 0.10 and 0.12 are in maintenance mode and will be unsupported at the
end of 2016. Node.js 4 is the current LTS version. If you are using an older
version of Node.js, we recommend upgrading to at least Node.js 4 as soon as
possible. If you are unable to upgrade to Node.js 4 or higher, then we recommend
continuing to use standard
v7.x until you are ready to upgrade Node.js.
Important: We will not be updating the standard
v7.x versions going forward.
All bug fixes and enhancements will land in standard
v8.x.
Full changelog below. Cheers!
- Upgrade to ESLint v3 (http://eslint.org/docs/user-guide/migrating-to-3.0.0) #565
- BREAKING: Drop support for node < 4 (this was a decision made by the ESLint team)
- Expose ESLint's
--fix
command line flag #540 standard-engine/#107- Lightweight, no additional dependencies, fixes dozens of rules automatically
(Estimated % of affected standard users, based on test suite in parens)
- Enforce placing object properties on separate lines (object-property-newline) #524 (2%)
- Require block comments to be balanced (spaced-comment "balanced") #572 (2%)
- Disallow constant expressions in conditions (no-constant-condition) #563 (1%)
- Disallow renaming import, export, and destructured assignments to the same name (no-useless-rename) #537 (0%)
- Disallow spacing between rest and spread operators and their expressions (rest-spread-spacing) #567 (0%)
- Disallow the Unicode Byte Order Mark (BOM) (unicode-bom) #538 (0%)
- Disallow assignment to native objects/global variables (no-global-assign) #596 (0%)
- Disallow negating the left operand of relational operators (no-unsafe-negation) #595 (0%)
- Disallow template literal placeholder syntax in regular strings (no-template-curly-in-string) #594 (0%)
- Disallow tabs in file (no-tabs) #593 (0%)
- Relax rule: Allow template literal strings (backtick strings) to avoid escaping #421
- Relax rule: Do not enforce spacing around * in generator functions (standard#564 (comment))
- This is a temporary workaround for
babel
users who use async generator functions.
- This is a temporary workaround for
- Fix install errors for some users by updating eslint peer dependency
- Add back full node 0.10, 0.12 support
- Upgrade eslint to version ~2.10.2
- Relax "no-duplicate-imports" rule to not include
export
so the following is allowed:
import { foo } from 'bar'
export * from 'bar'
- Upgrade eslint to version ~2.9.0
- Remove "rules" configuration option #367 from
package.json
(Reasoning is here)
Estimated % of affected standard users, based on test suite
- Require camelCase (camelcase) [4%]
- Disallow unnecessary escape usage (no-useless-escape) [4% -- but, including many bugs]
- Disallow duplicate imports (no-duplicate-imports) [0%]
- Disallow unmodified conditions of loops (no-unmodified-loop-condition) [0%]
- Disallow whitespace before properties (no-whitespace-before-property) [0%]
- Disallow control flow statements in
finally
blocks (no-unsafe-finally) [0%] - Disallow unnecessary computed property keys on objects (no-useless-computed-key) [0%]
- Validate spacing before closing bracket in JSX (react/jsx-space-before-closing) [0%]
- Require parens in arrow function arguments (arrow-parens)
- Pin eslint to version ~2.2.0
- Update eslint-plugin-react to version 4.0.0
- Revert: Use install location of standard as eslint
cwd
(fixes #429)
- Use eslint 2.1.0
- Fix: Use install location of standard as eslint
cwd
(fixes snazzy/#8)
- Use eslint 2.0.0 stable
- Relax rule: Validate closing bracket location in JSX (jsx-closing-bracket-location)
- Fix "Error: Cannot find module 'eslint-config-standard-jsx'" with npm 2 (node 0.10, 0.12, 4)
- Internal change: Remove .eslintrc file, and use inline config
- Internal change: Move .eslintrc file to root folder
The goal of this release is to make standard
faster to install, and simpler to use.
- Eliminates 250 packages, and cuts install time in half!
- For npm 2, install time goes from 20 secs —> 10 secs.
- For npm 3, install time goes from 24 secs —> 12 secs.
- To continue using
standard-format
, just install it separately:npm install -g standard-format
React-specific linting rules are removed (#351) (#367) (eslint-config-standard-react/#13)
- JSX is still supported, and it continues to be checked for style.
- There were only a few React-specific rules, but they made it extremely difficult for users of alternatives like
virtual-dom
ordeku
, and unecessarily tiedstandard
to a single library. - JSX rules come from
eslint-config-standard-jsx
. Theeslint-config-standard-react
dependency was removed.
The percentage (%) of users that rule changes will effect, based on real-world testing of the top ~400 npm packages is denoted in brackets.
- Disallow
__dirname
/__filename
string concatenation (#403) (no-path-concat) [5%] - Require parens in arrow function arguments (#309) (arrow-parens) [5%]
- Ensure that
new Promise()
is instantiated with the parameter namesresolve
,reject
(#282) (promise/param-names) [1%] - Enforce Usage of Spacing in Template Strings (template-curly-spacing) [1%]
- Template strings are only allowed when necessary, i.e. template string features are being used (eslint got stricter: eslint/eslint#5147) [1%]
- Better dead code detection after conditional statements (eslint got stricter) [1%]
- Enforce spaces around
*
inyield * something
(#335) (yield-star-spacing) [0%] - Disallow labels on loops/switch statements too (made rule stricter) (no-labels) [0%]
- Disallow unnecessary constructor (no-useless-constructor) [0%]
- Disallow empty destructuring patterns (no-empty-pattern) [0%]
- Disallow Symbol Constructor (no-new-symbol) [0%]
- Disallow Self Assignment (no-self-assign) [0%]
For power users, it might be easier to use one of these new hooks instead of forking
standard
, though that's still encouraged, too!
To set custom ESLint plugins, rules, or envs, use the command line --plugin
, --rules
, and --env
flags.
In package.json
, use the "standard" property:
{
"standard": {
"plugins": [ "my-plugin" ]
}
}
- There may be slight behavior changes to existing rules. When possible, we've noted these in the "New Rules" and "Removed Rules" section.
- Rule changes can be tested against every package on npm. For sanity, this is limited to packages with at least 4 dependents. Around ~400 packages.
- Using prerelease eslint version (2.0.0-rc.0). There may be breaking changes before the stable release.
no-return-assign
behavior changed with arrow functions (eslint/eslint#5150)
- standard (v5.4.1...v6.0.0)
- eslint-config-standard (v4.4.0...v5.0.0)
- eslint-config-standard-jsx (v1.0.0)
- standard-engine (v2.2.4...v3.2.1)
- Fix for
standard-engine
change. Fix error tagline.
- [email protected] (history)
- Disallow duplicate JSX properties
- [email protected] (history)
- [email protected] (history)
- [email protected] (history)
- [email protected] (history)
- We have a changelog now, and you're reading it!
- Minor README update
- Removed direct dependency on
eslint
(its now moved to standard-engine)
- [email protected] (history)
- Revert rule: Disallow unncessary concatenation of strings
- [email protected] (history)
- fix regression with ternary operator handling
- [email protected] (history)
- New rule: Disallow unncessary concatenation of strings
- New rule: Disallow duplicate name in class members
- New rule: enforce spaces inside of single line blocks
- Re-add rule: padded-blocks (Closes #170)
- Bump
eslint
from 1.1.0 to 1.3.1 (CHANGELOG) - [email protected] (history)
- A small change to make the plugin compatible with browserify which does not affect behavior.
- [email protected] (CHANGELOG)
- Fix object rest/spread handling.
- Added white background to badge.svg to make it work with dark backgrounds (Closes #234)
- Minor updates to README.md
- Update to RULES.md to remove a missing hyperlink
- Add atom linter information to README.md
- Fixed duplicated word in the tagline message on the CLI
- Removed failing repository from tests (yoshuawuyts/initialize)
- [email protected] (history)
- Added rest/spread feature to
eslintrc.json
to fix #226 and eslint-plugin-standard#3
- Added rest/spread feature to
- [email protected] (CHANGELOG)
- Fix crash when propTypes don't have any parent
- Fix jsx-no-literals reporting errors outside JSX
- Bump eslint from 1.0.0 to 1.2.0 (CHANGELOG)
- Added more test repositories and disabled some that were failing
- Update bikeshedding link on README.md
- [email protected] (history)
- Disable Rule: react/wrap-multilines
- Minor README updates