Change Log
[9.1.2][] - 2025-06-06
- Add node.js 24 to CI
- Update dependencies
[9.1.1][] - 2024-10-24
- Update space-before-function-paren
[9.1.0][] - 2024-10-21
- Added more global idenifiers for node and browser environment
- Add node.js 23 to CI
[9.0.7][] - 2024-09-12
- Merge rules from all style guides
[9.0.6][] - 2024-09-03
[9.0.5][] - 2024-08-31
- Add more global classes
- Fix github template
[9.0.4][] - 2024-08-27
- Add much more node.js and frontend globals
- Move globals to separate submodule
[9.0.3][] - 2024-08-18
- Add more frontend globals
[9.0.2][] - 2024-08-16
- Add node.js backend globals
- Mode devDependencies to dependencies
[9.0.1][] - 2024-08-15
- Resolve formatting conflict between ESLint and Prettier
- Update npm scripts and remove /scripts folder from package
[9.0.0][] - 2024-08-14
- Update eslint to 9.x: Rewrite rules to plain format
- Drop node.js 18.x support and add node.js 22 support
- Update repository structure, CI, and badges
- Update dependencies and package file structure
[8.2.1][] - 2023-07-20
- Update dependencies and package file structure
[8.2.0][] - 2023-07-06
- Updated: consistent-return
[8.1.0][] - 2022-06-21
- Updated: arrow-parens, handle-callback-err, operator-linebreak
[8.0.0][] - 2022-06-04
- Dependencies updated to latest versions
- ECMAScript 13 (2022) features support
All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
7.0.0 (2019-02-01)
Features
- rules: change space-before-function-paren for async functions (#26) (c5922b2)
- rules: disallow unnecessary return await (#27) (d49c1ac)
BREAKING CHANGES
- rules: with this change it is an error to not have a space
before function parentheses in an async function declaration.
Before:
const a = async() => {};
After:
const a = async () => {};
- rules: with this it is an error to use return await in an
async function where it doesn't bring any benefits. Note that separate
await and then return or return await inside of the try-catch block are
still allowed.
This is an error:
async function foo() {
return await bar();
}
These are not:
async function foo() {
await bar();
return;
}
async function foo() {
try {
return await bar();
} catch (e) {}
}
6.1.0 (2018-12-07)
Features
- rules: add parserOptions and set ecmaVersion to 2018 (#24) (18d8cd5)
- rules: enable allowTemplateLiterals option for quotes rule (#23) (00e3ac2)
6.0.0 (2018-10-22)
Features
- rules: add no-extra-parens rule (#21) (226fc9c)
- rules: add no-return-assign rule (#19) (e8838ed)
- rules: remove implicit-arrow-linebreak rule (#20) (d4f68d9)
BREAKING CHANGES
- rules: with this change it is allowed to use parentheses
only where they are necessary, except for arrow conditionals (to avoid
conflicts with no-confusing-arrow rule), return assignments (to avoid
conflicts with no-return-assign rule) and nested binary expressions
(where parentheses can be used for clarity).
Before:
a = (b * c);
typeof (a);
const fn = () => (
doSomething()
);
After:
a = b * c;
typeof a;
const fn = () => doSomething();
- rules: before, it was possible to use assignment operators in
a return statement without using parentheses, which could lead to some
mistakes, where assignment operators are used in place of the comparison
operators.
Before:
function doSomething() {
return foo = bar + 2;
}
After:
function doSomething() {
return foo === bar + 2;
}
function doSomething() {
return (foo = bar + 2);
}
5.0.0 (2018-09-28)
Features
- rules: add consistent-return rule (#15) (e91c939)
- rules: enforce curly braces on multiline blocks (#16) (3132fdc)
BREAKING CHANGES
- rules: before this change, it was possible to have a function
that used the
return
statement with a value only in some of its
execution paths. This rule enforces function to explicitly return a
value in every execution path if at least one execution path returns a
value.
Before:
function doSomething(condition) {
if (condition) {
return true;
} else {
return;
}
}
After:
function doSomething(condition) {
if (condition) {
return true;
} else {
return false;
}
}
function doSomething(condition) {
if (condition) {
return true;
}
return false;
}
- rules: before this change, it was allowed to avoid the use of
block statements (curly braces) with
if
, else
, for
, while
, and
do
, when there is only one statement in the block. After this change,
omitting the curly braces is only allowed when the statement is on the
same line as if
, else if
, else
, for
, while
, or do
. Also,
this change enforces consistency in the usage of curly braces for if
,
else if
and else
chains.
Before:
if (foo)
bar();
if (x) a();
else {
b();
c();
}
After:
if (foo) bar();
if (foo) {
bar();
}
if (x) {
a();
} else {
b();
c();
}
Some of the problems reported by this rule can be fixed via
eslint --fix
.
4.0.0 (2018-08-22)
Features
- rules: omit arrow function parens unless they are necessary (#11) (16d56e4)
BREAKING CHANGES
- rules: previously, only arrow functions consisting of a single
expression were allowed to omit parentheses around the parameter list
(and required to, if there's only one parameter in the list). After
this change, the parens are only allowed when they are required
syntactically.
Before:
const f = x => x;
const g = (x, y) => x + y;
const h = (x) => {
console.log(x);
};
const i = (x, f) => {
f(x);
};
After:
const f = x => x;
const g = (x, y) => x + y;
const h = x => {
console.log(x);
};
const i = (x, f) => {
f(x);
};
This rule is fixable via eslint --fix
.
Refs: https://github.com/metarhia/Metarhia/issues/22
3.0.0 (2018-07-19)
Features
- eslint: upgrade to ESLint 5 (a4ee615)
BREAKING CHANGES
2.0.0 (2017-11-26)
Features
- rules: add implicit-arrow-linebreak rule (75748ff)
BREAKING CHANGES
rules: before this change, if doSomething()
in the following
snippet of code
const fn = () => doSomething();
could not fit on one line, both
const fn = () => (
doSomething()
);
and
const fn = () =>
doSomething();
would be valid from the point of view of ESLint.
After this change, only
const fn = () => (
doSomething()
);
is valid.
Also, it is required to update ESLint.
1.0.1 (2017-09-25)
1.0.0 (2017-09-06)
Features
- config: add basic ESLint config (289e2e4)
- config: export configuration from the module (290d450)
- rules: add arrow-parens rule (6d431e4)
- rules: add comma-dangle rule (29b66fe)
- rules: add handle-callback-err rule (e083dd4)
- rules: add import/no-unresolved rule (5962ba5)