Skip to content

Commit 4f355f2

Browse files
authored
Develop @eslint-recommended/eslint-config-typescript (#1)
* Create .nvmrc * Create package.json * Create package-lock.json * Create index.js * Create .eslintrc.js * Create eslint.yml * Create release.yml * Create renovate.json * Update README
1 parent 5bc3ca7 commit 4f355f2

File tree

9 files changed

+2323
-1
lines changed

9 files changed

+2323
-1
lines changed

.eslintrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// @ts-check
2+
3+
/** @typedef {import("eslint").Linter.BaseConfig } BaseConfig */
4+
5+
/** @type {BaseConfig} */
6+
const config = {
7+
extends: './index.js',
8+
rules: {
9+
'unicorn/prefer-module': 'off'
10+
}
11+
}
12+
13+
module.exports = config

.github/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
changelog:
2+
categories:
3+
- title: "Breaking changes"
4+
labels:
5+
- "breaking change"
6+
- title: "New features"
7+
labels:
8+
- "enhancement"
9+
- title: "Bug fixes"
10+
labels:
11+
- "bug"
12+
- title: "Dependency updates"
13+
labels:
14+
- "dependencies"
15+
- "renovate"
16+
- title: "Documentation"
17+
labels:
18+
- "documentation"
19+
- title: "Other changes"
20+
labels:
21+
- "*"

.github/renovate.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"github>eslint-recommended/renovate-config"
4+
]
5+
}

.github/workflows/eslint.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: eslint
2+
on:
3+
pull_request:
4+
branches: [ main ]
5+
jobs:
6+
eslint:
7+
name: runner / eslint
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: eslint
12+
uses: reviewdog/action-eslint@v1
13+
with:
14+
reporter: github-pr-check

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14.18.3

README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,58 @@
1-
# eslint-config-typescript
1+
[![npm version](https://badge.fury.io/js/%40eslint-recommended%2Feslint-config-typescript.svg)](https://badge.fury.io/js/%40eslint-recommended%2Feslint-config-typescript)
2+
[![eslint](https://github.com/eslint-recommended/eslint-config-typescript/actions/workflows/eslint.yml/badge.svg)](https://github.com/eslint-recommended/eslint-config-typescript/actions/workflows/eslint.yml)
3+
4+
# @eslint-recommended/eslint-config-typescript
5+
26
Recommended ESLint Shareable Config for TypeScript
7+
8+
## Peer dependencies
9+
10+
- [eslint](https://www.npmjs.com/package/eslint)
11+
- [eslint-config-standard-with-typescript](https://www.npmjs.com/package/eslint-config-standard-with-typescript)
12+
- [eslint-plugin-eslint-comments](https://www.npmjs.com/package/eslint-plugin-eslint-comments)
13+
- [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import)
14+
- [eslint-plugin-n](https://www.npmjs.com/package/eslint-plugin-n)
15+
- [eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise)
16+
- [eslint-plugin-unicorn](https://www.npmjs.com/package/eslint-plugin-unicorn)
17+
- [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
18+
19+
## Usage
20+
21+
### Install packages
22+
23+
#### npm@>=7
24+
25+
Install `@eslint-recommended/eslint-config-typescript`.
26+
27+
```sh
28+
npm i -D @eslint-recommended/eslint-config-typescript
29+
```
30+
31+
#### npm@<7
32+
33+
Install `@eslint-recommended/eslint-config-typescript` and its peer dependencies.
34+
35+
```sh
36+
npm i -D \
37+
eslint \
38+
eslint-config-standard-with-typescript \
39+
eslint-plugin-eslint-comments \
40+
eslint-plugin-import \
41+
eslint-plugin-n \
42+
eslint-plugin-promise \
43+
eslint-plugin-unicorn \
44+
@typescript-eslint/eslint-plugin \
45+
@eslint-recommended/eslint-config-typescript
46+
```
47+
48+
### Use in ESLint config
49+
50+
Add `@eslint-recommended/eslint-config-typescript` to `extends` of your ESLint config.
51+
52+
```json
53+
{
54+
"extends": [
55+
"@eslint-recommended/eslint-config-typescript"
56+
]
57+
}
58+
```

index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// @ts-check
2+
3+
/** @typedef {import("eslint").Linter.BaseConfig} BaseConfig */
4+
5+
/** @type {BaseConfig} */
6+
const config = {
7+
extends: [
8+
'standard-with-typescript',
9+
'plugin:unicorn/recommended',
10+
'plugin:eslint-comments/recommended'
11+
]
12+
}
13+
14+
module.exports = config

0 commit comments

Comments
 (0)