This is an ESLint package to use across POLARIS projects to maintain the same standard of code. It provides a common configuration, as well as Node and React specific configurations.
This is published to two registries (Github Packages and NPM) on every merge of a pull request to the main
branch.
In the project root, run:
npm i --save-dev @polarislabs/eslint-config-polaris
In the project .eslintrc.js
file, erase anything in there, and replace with:
module.exports = {
extends: [
'@polarislabs/polaris',
],
};
This will use the default JS + TS ESLint rules. If you want the Node/React specific rules, you can instead do:
module.exports = {
extends: [
'@polarislabs/polaris/node',
],
};
or
module.exports = {
extends: [
'@polarislabs/polaris/react',
],
};
In order to do development of this package, install it from another local source code repository so that you can test that it works.
For instance, typescript
is required. Make sure that NODE_ENV=development
and do an npm install in the root of eslint-config-polaris
.
npm install ../path/to/eslint-config-polaris
Add to your .eslintrc.js
per Usage
section above.
When making a pull request, label the PR with the type of semver version bump you wish to make (major
, minor
, or patch
), and Github Actions will take care of the whole release process. It will:
- Substitute
x.x.x
in the changelog with the new version number - Move the changelog to the
docs/changelogs
directory, and start a new one from a template - Version bump the
package.json
andpackage-lock.json
- Commit, tag, and push the results to
main
- Publish the package to Github Packages and NPM
- And create a Github Release