eslint-config-metarhia
Opinionated ESLint config and de-facto JavaScript styleguide for
Metarhia projects.
Usage
-
Install ESLint, this config and required plugins:
npm i -D eslint eslint-plugin-import eslint-config-metarhia
-
Add "extends": "metarhia"
to your .eslintrc
.
Contributing
Please adhere to Conventional Commits styleguide for commit messages (npm install
creates a Git hook that lints your commit messages, and they are also
checked on CI, but please write them properly beforehand so that they don't get
rejected. If that happens locally while committing, though, don't worry, your
commit message isn't lost, you can still find it in .git/COMMIT_EDITMSG
).
Releasing
Collaborators can release new versions using
npm run release
git push origin master --follow-tags
npm publish
This will update the version in package.json
and package-lock.json
according to semantic versioning using commit messages to determine whether it
is a patch, minor or major release, update the changelog, tag the new version
in Git, and publish it to npm registry.
License
MIT. See the LICENSE file for details.
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:
// Not affected
const f = x => x;
// Not affected
const g = (x, y) => x + y;
// AFFECTED
const h = x => {
console.log(x);
};
// Not affected
const i = (x, f) => {
f(x);
};
This rule is fixable via eslint --fix
.
Refs: https://github.com/metarhia/Metarhia/issues/22
<a name="3.0.0"></a>