Skip to content

Commit 787e8ad

Browse files
committed
docs: update README files
1 parent dc3361b commit 787e8ad

File tree

4 files changed

+108
-30
lines changed

4 files changed

+108
-30
lines changed

README.md

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,12 @@
1-
# @actcoding/eslint-config
1+
# eslint-config
22

3-
> An opinionated eslint flat config.
3+
> A set of opinionated eslint configs and plugins we use in most of our projects.
44
5-
This package provides multiple, opinionated eslint configs we use in our projects.
5+
## Projects
66

7-
## Install
8-
9-
```shell
10-
npm install -D @actcoding/eslint-config
11-
```
12-
13-
## Usage
14-
15-
`eslint.config.js`
16-
17-
```js
18-
import { configActDefault } from '@actcoding/eslint-config'
19-
20-
/** @type {import('eslint').Linter.Config[]} */
21-
const config = [
22-
...configActDefault,
23-
{
24-
ignores: [
25-
'*.d.ts',
26-
]
27-
}
28-
]
29-
30-
export default config
31-
```
7+
- [`eslint-config`](./packages/eslint-config/README.md): The main shareable ESLint config
8+
- [`eslint-plugin-import-newlines`](./packages/eslint-plugin-import-newlines/README.md): A customized, typed and updated version of [SeinopSys/eslint-plugin-import-newlines](https://github.com/SeinopSys/eslint-plugin-import-newlines)
329

3310
## License
3411

35-
[MIT](LICENSE)
12+
All packages are published under the [MIT license](LICENSE)

packages/eslint-config/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# @actcoding/eslint-config
2+
3+
> An opinionated eslint flat config.
4+
5+
This package provides multiple, opinionated eslint configs we use in our projects.
6+
7+
## Install
8+
9+
```shell
10+
npm install -D @actcoding/eslint-config
11+
```
12+
13+
## Usage
14+
15+
`eslint.config.js`
16+
17+
```js
18+
import { configActDefault } from '@actcoding/eslint-config'
19+
20+
/** @type {import('eslint').Linter.Config[]} */
21+
const config = [
22+
...configActDefault,
23+
{
24+
ignores: [
25+
'*.d.ts',
26+
]
27+
}
28+
]
29+
30+
export default config
31+
```
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# @actcoding/eslint-plugin-import-newlines
2+
3+
> ESLint plugin for enforcing newlines in ES6 import statements past a certain number of items.
4+
5+
Parts of the code are taken from [SeinopSys/eslint-plugin-import-newlines](https://github.com/SeinopSys/eslint-plugin-import-newlines), which is also [MIT licensed](https://github.com/SeinopSys/eslint-plugin-import-newlines/blob/main/LICENSE.md).
6+
7+
## Install
8+
9+
```shell
10+
npm install -D @actcoding/eslint-plugin-import-newlines
11+
```
12+
13+
## Usage
14+
15+
### Provided config (recommended)
16+
17+
`eslint.config.js`
18+
19+
```js
20+
import importNewlinesPlugin from '@actcoding/eslint-plugin-import-newlines'
21+
22+
/** @type {import('eslint').Linter.Config[]} */
23+
const config = [
24+
importNewlinesPlugin.configs.recommended,
25+
]
26+
27+
export default config
28+
```
29+
30+
### Manual
31+
32+
`eslint.config.js`
33+
34+
```js
35+
import importNewlinesPlugin from '@actcoding/eslint-plugin-import-newlines'
36+
37+
/** @type {import('eslint').Linter.Config[]} */
38+
const config = [
39+
{
40+
name: 'app/style/imports',
41+
plugins: {
42+
'@import-newlines': importNewlinesPlugin,
43+
},
44+
rules: {
45+
'@import-newlines/enforce': [
46+
'error',
47+
{
48+
'maxItems': 4,
49+
'maxLineLength': 120,
50+
},
51+
],
52+
},
53+
},
54+
]
55+
56+
export default config
57+
```
58+
59+
## Rules
60+
61+
### `@import-newlines/enforce`
62+
63+
Enforce multiple lines for import statements past a certain number of items
64+
65+
#### Options
66+
67+
| Option | Type | Default | Description |
68+
| --- | --- | --- | --- |
69+
| maxItems | `integer` | 4 | maximum amount of imported items per line |
70+
| maxLineLength | `integer` | 120 | maximum line length of an import statement |

packages/eslint-plugin-import-newlines/lib/rules/enforce/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const plugin: Rule.RuleModule = {
2828
meta: {
2929
type: 'layout',
3030
docs: {
31-
description: 'enforce multiple lines for import statements past a certain number of items',
31+
description: 'Enforce multiple lines for import statements past a certain number of items',
3232
category: 'Stylistic Issues',
3333
url: 'https://github.com/actcoding/eslint-config',
3434
},

0 commit comments

Comments
 (0)