Skip to content

Commit b605a98

Browse files
committed
Update README.md
1 parent f463b94 commit b605a98

File tree

1 file changed

+46
-13
lines changed

1 file changed

+46
-13
lines changed

README.md

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,59 @@
1-
Introduction
2-
=
3-
ESLint configuration for micro-services built using Node.js and TypeScript.
1+
# eslint-config-oncehub
2+
3+
[![Build status](https://github.com/scheduleonce/eslint-config-oncehub/actions/workflows/node.js.yml/badge.svg)](https://github.com/scheduleonce/eslint-config-oncehub/actions) [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
4+
5+
> ESLint configuration for services built with Node.js and TypeScript.
46
57
The configuration extends `@typescript-eslint/recommended`, `eslint-plugin-sonarjs`, `prettier` ESLint configurations.
68

9+
It is compatible with ESlint >= v9 configuration format (flat config).
10+
711
## Installation
8-
Using **NPM**
9-
```sh
10-
npm i --save-dev @oncehub/eslint-config
11-
```
1212

13-
Using **Yarn**
13+
To install this module, run the following command:
14+
1415
```sh
15-
yarn add --dev @oncehub/eslint-config
16+
$ npm install --save-dev @oncehub/eslint-config
1617
```
1718

19+
Note that it requires ESlint v9 and above.
20+
1821
## Usage
22+
1923
In your `.eslintrc` file, put `@oncehub/eslint-config` under `extends` array as shown below.
24+
2025
```js
2126
module.exports = {
22-
'extends': [
23-
'@oncehub/eslint-config'
24-
]
27+
extends: ["@oncehub/eslint-config"],
2528
};
26-
```
29+
```
30+
31+
## Development
32+
33+
### Tests
34+
35+
Run tests via `npm test`.
36+
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.
37+
38+
As a byproduct, the tests are also checking that the configuration is valid and all is okay with it.
39+
You can also further debug the config via:
40+
41+
```sh
42+
$ npx eslint --debug -c index.js index.js
43+
```
44+
45+
To generate a new rules snapshot file:
46+
47+
```sh
48+
$ npx eslint --print-config index.js -c index.js > output.json
49+
```
50+
51+
Copy the rules from the output file into `test/rules-snapshot.js`
52+
53+
### Deployment
54+
55+
Package is automatically published to npm when [creating a new release](.github/workflows/npm-publish.yml) on Github. Check out the release section in the repo. Read more about releases [here](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
56+
57+
## License
58+
59+
This module is licensed under the MIT License. See the LICENSE file for details.

0 commit comments

Comments
 (0)