mirror of
https://github.com/theoludwig/eslint-config-conventions.git
synced 2025-05-18 12:02:33 +02:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
08602b1c53 | |||
1779517f5c | |||
81b37b523c | |||
a95ac7ec8b | |||
32481c316f | |||
c3ddbc73b7 | |||
1934d3525a | |||
4f625c3b88 | |||
e24964a60a | |||
fcc107bdec | |||
666a3dee2d | |||
0ce46310ed |
@ -34,6 +34,7 @@
|
|||||||
"no-duplicate-imports": "error",
|
"no-duplicate-imports": "error",
|
||||||
"no-empty-character-class": "error",
|
"no-empty-character-class": "error",
|
||||||
"no-empty-pattern": "error",
|
"no-empty-pattern": "error",
|
||||||
|
"no-empty-static-block": "error",
|
||||||
"no-ex-assign": "error",
|
"no-ex-assign": "error",
|
||||||
"no-fallthrough": "error",
|
"no-fallthrough": "error",
|
||||||
"no-func-assign": "error",
|
"no-func-assign": "error",
|
||||||
@ -42,6 +43,7 @@
|
|||||||
"no-irregular-whitespace": "error",
|
"no-irregular-whitespace": "error",
|
||||||
"no-loss-of-precision": "error",
|
"no-loss-of-precision": "error",
|
||||||
"no-misleading-character-class": "error",
|
"no-misleading-character-class": "error",
|
||||||
|
"no-new-native-nonconstructor": "error",
|
||||||
"no-new-symbol": "error",
|
"no-new-symbol": "error",
|
||||||
"no-obj-calls": "error",
|
"no-obj-calls": "error",
|
||||||
"no-promise-executor-return": "error",
|
"no-promise-executor-return": "error",
|
||||||
@ -59,7 +61,7 @@
|
|||||||
"no-unsafe-negation": "error",
|
"no-unsafe-negation": "error",
|
||||||
"no-unsafe-optional-chaining": "error",
|
"no-unsafe-optional-chaining": "error",
|
||||||
"no-unused-private-class-members": "error",
|
"no-unused-private-class-members": "error",
|
||||||
"no-unused-vars": "error",
|
"no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
|
||||||
"no-use-before-define": [
|
"no-use-before-define": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
@ -166,6 +168,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"import/no-named-default": "error",
|
"import/no-named-default": "error",
|
||||||
|
"import/no-empty-named-blocks": "error",
|
||||||
|
|
||||||
"promise/param-names": "error",
|
"promise/param-names": "error",
|
||||||
"promise/no-new-statics": "error",
|
"promise/no-new-statics": "error",
|
||||||
@ -181,7 +184,8 @@
|
|||||||
"unicorn/no-this-assignment": "error",
|
"unicorn/no-this-assignment": "error",
|
||||||
"unicorn/no-zero-fractions": "error",
|
"unicorn/no-zero-fractions": "error",
|
||||||
"unicorn/prefer-node-protocol": "error",
|
"unicorn/prefer-node-protocol": "error",
|
||||||
"unicorn/throw-new-error": "error"
|
"unicorn/throw-new-error": "error",
|
||||||
|
"unicorn/no-typeof-undefined": "error"
|
||||||
},
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
@ -197,7 +201,10 @@
|
|||||||
"no-loss-of-precision": "off",
|
"no-loss-of-precision": "off",
|
||||||
"@typescript-eslint/no-loss-of-precision": "error",
|
"@typescript-eslint/no-loss-of-precision": "error",
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
"@typescript-eslint/no-unused-vars": "error",
|
"@typescript-eslint/no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{ "varsIgnorePattern": "^_" }
|
||||||
|
],
|
||||||
"no-use-before-define": "off",
|
"no-use-before-define": "off",
|
||||||
"@typescript-eslint/no-use-before-define": [
|
"@typescript-eslint/no-use-before-define": [
|
||||||
"error",
|
"error",
|
||||||
@ -241,13 +248,7 @@
|
|||||||
"error",
|
"error",
|
||||||
{ "default": "array-simple" }
|
{ "default": "array-simple" }
|
||||||
],
|
],
|
||||||
"@typescript-eslint/consistent-type-assertions": [
|
"@typescript-eslint/ban-types": "error",
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"assertionStyle": "as",
|
|
||||||
"objectLiteralTypeAssertions": "never"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@typescript-eslint/consistent-type-definitions": [
|
"@typescript-eslint/consistent-type-definitions": [
|
||||||
"error",
|
"error",
|
||||||
"interface"
|
"interface"
|
||||||
@ -308,7 +309,6 @@
|
|||||||
"ignoreMixedLogicalExpressions": false
|
"ignoreMixedLogicalExpressions": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@typescript-eslint/prefer-optional-chain": "error",
|
|
||||||
"@typescript-eslint/prefer-readonly": "error",
|
"@typescript-eslint/prefer-readonly": "error",
|
||||||
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
||||||
"@typescript-eslint/prefer-ts-expect-error": "error",
|
"@typescript-eslint/prefer-ts-expect-error": "error",
|
||||||
|
6
.github/workflows/lint.yml
vendored
6
.github/workflows/lint.yml
vendored
@ -10,10 +10,10 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v3.0.0'
|
- uses: 'actions/checkout@v3.5.0'
|
||||||
|
|
||||||
- name: 'Use Node.js'
|
- name: 'Use Node.js'
|
||||||
uses: 'actions/setup-node@v3.1.0'
|
uses: 'actions/setup-node@v3.6.0'
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
@ -24,5 +24,5 @@ jobs:
|
|||||||
- run: 'npm run lint:commit -- --to "${{ github.sha }}"'
|
- run: 'npm run lint:commit -- --to "${{ github.sha }}"'
|
||||||
- run: 'npm run lint:editorconfig'
|
- run: 'npm run lint:editorconfig'
|
||||||
- run: 'npm run lint:markdown'
|
- run: 'npm run lint:markdown'
|
||||||
- run: 'npm run lint:javascript'
|
- run: 'npm run lint:eslint'
|
||||||
- run: 'npm run lint:prettier'
|
- run: 'npm run lint:prettier'
|
||||||
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -8,13 +8,13 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v3.0.0'
|
- uses: 'actions/checkout@v3.5.0'
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: 'Use Node.js'
|
- name: 'Use Node.js'
|
||||||
uses: 'actions/setup-node@v3.1.0'
|
uses: 'actions/setup-node@v3.6.0'
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@ -10,10 +10,10 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v3.0.0'
|
- uses: 'actions/checkout@v3.5.0'
|
||||||
|
|
||||||
- name: 'Use Node.js'
|
- name: 'Use Node.js'
|
||||||
uses: 'actions/setup-node@v3.1.0'
|
uses: 'actions/setup-node@v3.6.0'
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{
|
||||||
"config": {
|
|
||||||
"default": true,
|
|
||||||
"MD013": false,
|
|
||||||
"MD033": false,
|
|
||||||
"MD041": false
|
|
||||||
},
|
|
||||||
"globs": ["**/*.{md,mdx}"],
|
"globs": ["**/*.{md,mdx}"],
|
||||||
"ignores": ["**/node_modules"]
|
"ignores": ["**/node_modules"],
|
||||||
|
"customRules": ["markdownlint-rule-relative-links"]
|
||||||
}
|
}
|
||||||
|
7
.markdownlint.json
Normal file
7
.markdownlint.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"default": true,
|
||||||
|
"relative-links": true,
|
||||||
|
"extends": "markdownlint/style/prettier",
|
||||||
|
"MD033": false,
|
||||||
|
"MD041": false
|
||||||
|
}
|
20
README.md
20
README.md
@ -40,10 +40,10 @@ Here is an example, but use it only for reference, because your decisions regard
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install --save-dev \
|
npm install --save-dev \
|
||||||
eslint@^8.9.0 \
|
eslint@^8.33.0 \
|
||||||
eslint-plugin-import@^2.26.0 \
|
eslint-plugin-import@^2.27.5 \
|
||||||
eslint-plugin-promise@^6.0.0 \
|
eslint-plugin-promise@^6.1.1 \
|
||||||
eslint-plugin-unicorn@^43.0.0 \
|
eslint-plugin-unicorn@^46.0.0 \
|
||||||
eslint-config-conventions@latest
|
eslint-config-conventions@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -62,9 +62,9 @@ If you want to use **TypeScript**, you also need to install:
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install --save-dev \
|
npm install --save-dev \
|
||||||
typescript@^4.8.2 \
|
typescript@^5.0.3 \
|
||||||
@typescript-eslint/eslint-plugin@^5.36.1 \
|
@typescript-eslint/eslint-plugin@^5.57.0 \
|
||||||
@typescript-eslint/parser@^5.36.1
|
@typescript-eslint/parser@^5.57.0
|
||||||
```
|
```
|
||||||
|
|
||||||
Dependencies are:
|
Dependencies are:
|
||||||
@ -109,7 +109,7 @@ echo {}> .prettierrc.json
|
|||||||
```jsonc
|
```jsonc
|
||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint:typescript": "eslint \"**/*.{js,jsx,ts,tsx}\" --ignore-path \".gitignore\"",
|
"lint:eslint": "eslint \"**/*.{js,jsx,ts,tsx}\" --ignore-path \".gitignore\"",
|
||||||
"lint:prettier": "prettier \".\" --check --ignore-path \".gitignore\""
|
"lint:prettier": "prettier \".\" --check --ignore-path \".gitignore\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,9 +118,9 @@ echo {}> .prettierrc.json
|
|||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm run lint:typescript
|
npm run lint:eslint
|
||||||
# or to apply automatic fixes to code
|
# or to apply automatic fixes to code
|
||||||
npm run lint:typescript -- --fix
|
npm run lint:eslint -- --fix
|
||||||
|
|
||||||
# Validate code formatting in all supported languages by Prettier
|
# Validate code formatting in all supported languages by Prettier
|
||||||
npm run lint:prettier
|
npm run lint:prettier
|
||||||
|
14262
package-lock.json
generated
14262
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@ -35,7 +35,7 @@
|
|||||||
"lint:commit": "commitlint",
|
"lint:commit": "commitlint",
|
||||||
"lint:editorconfig": "editorconfig-checker",
|
"lint:editorconfig": "editorconfig-checker",
|
||||||
"lint:markdown": "markdownlint-cli2",
|
"lint:markdown": "markdownlint-cli2",
|
||||||
"lint:javascript": "eslint \"**/*.{js,jsx,ts,tsx}\" -c \"eslintrc.json\"",
|
"lint:eslint": "eslint \"**/*.{js,jsx,ts,tsx}\" -c \"eslintrc.json\"",
|
||||||
"lint:prettier": "prettier \".\" --check --ignore-path \".gitignore\"",
|
"lint:prettier": "prettier \".\" --check --ignore-path \".gitignore\"",
|
||||||
"lint:staged": "lint-staged",
|
"lint:staged": "lint-staged",
|
||||||
"test": "tap",
|
"test": "tap",
|
||||||
@ -45,30 +45,32 @@
|
|||||||
"postpublish": "pinst --enable"
|
"postpublish": "pinst --enable"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^8.9.0",
|
"eslint": "^8.33.0",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-promise": "^6.0.0",
|
"eslint-plugin-promise": "^6.1.1",
|
||||||
"eslint-plugin-unicorn": "^43.0.0"
|
"eslint-plugin-unicorn": "^46.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "17.1.2",
|
"@commitlint/cli": "17.5.1",
|
||||||
"@commitlint/config-conventional": "17.1.0",
|
"@commitlint/config-conventional": "17.4.4",
|
||||||
"@types/eslint": "8.4.6",
|
"@tsconfig/strictest": "2.0.0",
|
||||||
"@types/tap": "15.0.7",
|
"@types/eslint": "8.37.0",
|
||||||
"@typescript-eslint/eslint-plugin": "5.36.1",
|
"@types/tap": "15.0.8",
|
||||||
"@typescript-eslint/parser": "5.36.1",
|
"@typescript-eslint/eslint-plugin": "5.57.0",
|
||||||
"editorconfig-checker": "4.0.2",
|
"@typescript-eslint/parser": "5.57.0",
|
||||||
"eslint": "8.23.0",
|
"editorconfig-checker": "5.0.1",
|
||||||
"eslint-plugin-import": "2.26.0",
|
"eslint": "8.37.0",
|
||||||
"eslint-plugin-promise": "6.0.1",
|
"eslint-plugin-import": "2.27.5",
|
||||||
"eslint-plugin-unicorn": "43.0.2",
|
"eslint-plugin-promise": "6.1.1",
|
||||||
"husky": "8.0.1",
|
"eslint-plugin-unicorn": "46.0.0",
|
||||||
"lint-staged": "13.0.3",
|
"husky": "8.0.3",
|
||||||
"markdownlint-cli2": "0.5.1",
|
"lint-staged": "13.2.0",
|
||||||
|
"markdownlint-cli2": "0.6.0",
|
||||||
|
"markdownlint-rule-relative-links": "1.1.1",
|
||||||
"pinst": "3.0.0",
|
"pinst": "3.0.0",
|
||||||
"prettier": "2.7.1",
|
"prettier": "2.8.7",
|
||||||
"semantic-release": "19.0.5",
|
"semantic-release": "21.0.1",
|
||||||
"tap": "16.3.0",
|
"tap": "16.3.4",
|
||||||
"typescript": "4.8.2"
|
"typescript": "5.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
{
|
{
|
||||||
|
"extends": "@tsconfig/strictest/tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"lib": ["ESNext"],
|
"lib": ["ESNext"],
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"rootDir": "./",
|
"rootDir": "./"
|
||||||
"strict": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"esModuleInterop": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user