ESLint configuration for services built with Node.js and TypeScript.
The configuration exports and extends @typescript-eslint/recommended
, eslint-plugin-sonarjs
, prettier
ESLint configurations.
It is compatible with ESlint >= v9 configuration format (flat config).
To install this module, run the following command:
$ npm install --save-dev @oncehub/eslint-config
Note that it requires ESlint v9 and above.
Import the package inside of an eslint.config.js
file and add it into the exported array, like this:
// eslint.config.js
import oncehub from "@oncehub/eslint-config";
export default [...oncehub];
Run tests via npm test
.
The tests are comparing the eslint configuration against a previously saved snapshot of the rules so if you are adding or removing any rule, make sure to update the tests.
As a byproduct, the tests are also checking that the configuration is valid and all is okay with it. You can also further debug the config via:
$ npx eslint --debug -c index.js index.js
To generate a new rules snapshot file:
$ npx eslint --print-config index.js -c index.js > output.json
Copy the rules from the output file into test/rules-snapshot.js
Package is automatically published to npm when creating a new release on Github. Check out the release section in the repo. Read more about releases here.
This module is licensed under the MIT License. See the LICENSE file for details.