@bifravst/eslint-config-typescript 5.0.89 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +12 -9
- package/eslint.config.js +81 -0
- package/package.json +37 -33
- package/index.js +0 -63
- package/package-lock.json +0 -6696
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TypeScript ESLint Config [](https://www.npmjs.com/package/@bifravst/eslint-config-typescript)
|
|
2
2
|
|
|
3
3
|
[](https://github.com/bifravst/eslint-config-typescript/actions)
|
|
4
|
-
[](https://snyk.io/test/github/bifravst/eslint-config-typescript)
|
|
5
4
|
[](https://github.com/semantic-release/semantic-release)
|
|
6
5
|
[](https://renovatebot.com)
|
|
7
|
-
[](http://commitizen.github.io/cz-cli/)
|
|
6
|
+
[](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional)
|
|
9
7
|
[](https://github.com/prettier/prettier/)
|
|
10
8
|
[](https://github.com/typescript-eslint/typescript-eslint)
|
|
11
9
|
|
|
12
|
-
ESLint configuration (with
|
|
13
|
-
|
|
14
|
-
for all Bifravst projects.
|
|
10
|
+
ESLint configuration (with [TypeScript support](https://typescript-eslint.io/))
|
|
11
|
+
for all our projects.
|
|
15
12
|
|
|
16
|
-
See
|
|
13
|
+
See
|
|
14
|
+
[@nordicsemiconductor/asset-tracker-cloud-code-style](https://github.com/NordicSemiconductor/asset-tracker-cloud-code-style-js#readme)
|
|
15
|
+
for usage.
|
|
17
16
|
|
|
18
17
|
## Installation
|
|
19
18
|
|
|
20
|
-
npm i --save-dev @bifravst/eslint-config-typescript
|
|
19
|
+
npm i --save-dev --save-exact @bifravst/eslint-config-typescript
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
echo '{"extends": "@bifravst/eslint-config-typescript"}' > .eslintrc.json
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import eslint from '@eslint/js'
|
|
4
|
+
import tseslint from 'typescript-eslint'
|
|
5
|
+
import unicorn from 'eslint-plugin-unicorn'
|
|
6
|
+
import preferArrow from 'eslint-plugin-prefer-arrow'
|
|
7
|
+
import prettier from 'eslint-config-prettier'
|
|
8
|
+
import * as importPlugin from 'eslint-plugin-import'
|
|
9
|
+
|
|
10
|
+
export default tseslint.config(
|
|
11
|
+
eslint.configs.recommended,
|
|
12
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
13
|
+
{
|
|
14
|
+
languageOptions: {
|
|
15
|
+
parserOptions: {
|
|
16
|
+
project: true,
|
|
17
|
+
tsconfigRootDir: import.meta.dirname,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
prettier,
|
|
22
|
+
unicorn.configs['flat/all'],
|
|
23
|
+
{ plugins: { 'prefer-arrow': preferArrow, import: importPlugin } },
|
|
24
|
+
{
|
|
25
|
+
rules: {
|
|
26
|
+
'@typescript-eslint/indent': ['off'],
|
|
27
|
+
'@typescript-eslint/no-object-literal-type-assertion': ['off'],
|
|
28
|
+
'@typescript-eslint/explicit-function-return-type': ['off'],
|
|
29
|
+
'@typescript-eslint/await-thenable': ['error'],
|
|
30
|
+
'@typescript-eslint/no-extraneous-class': ['error'],
|
|
31
|
+
'@typescript-eslint/no-floating-promises': ['error'],
|
|
32
|
+
'@typescript-eslint/no-for-in-array': ['error'],
|
|
33
|
+
'@typescript-eslint/no-require-imports': ['error'],
|
|
34
|
+
'@typescript-eslint/no-this-alias': ['error'],
|
|
35
|
+
'@typescript-eslint/no-type-alias': ['off'],
|
|
36
|
+
'@typescript-eslint/no-unnecessary-type-assertion': ['error'],
|
|
37
|
+
'@typescript-eslint/no-useless-constructor': ['error'],
|
|
38
|
+
'@typescript-eslint/prefer-for-of': ['error'],
|
|
39
|
+
'@typescript-eslint/prefer-function-type': ['error'],
|
|
40
|
+
'@typescript-eslint/prefer-includes': ['error'],
|
|
41
|
+
'@typescript-eslint/prefer-readonly': ['error'],
|
|
42
|
+
'@typescript-eslint/prefer-regexp-exec': ['error'],
|
|
43
|
+
'@typescript-eslint/prefer-string-starts-ends-with': ['error'],
|
|
44
|
+
'@typescript-eslint/promise-function-async': ['error'],
|
|
45
|
+
'@typescript-eslint/require-array-sort-compare': ['error'],
|
|
46
|
+
'@typescript-eslint/restrict-plus-operands': ['error'],
|
|
47
|
+
semi: 'off',
|
|
48
|
+
'@typescript-eslint/semi': ['off'],
|
|
49
|
+
'@typescript-eslint/member-delimiter-style': [
|
|
50
|
+
'error',
|
|
51
|
+
{
|
|
52
|
+
multiline: {
|
|
53
|
+
delimiter: 'none',
|
|
54
|
+
requireLast: false,
|
|
55
|
+
},
|
|
56
|
+
singleline: {
|
|
57
|
+
delimiter: 'semi',
|
|
58
|
+
requireLast: false,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
'@typescript-eslint/prefer-interface': ['off'],
|
|
63
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
64
|
+
'@typescript-eslint/no-explicit-any': ['off'],
|
|
65
|
+
'no-console': ['off'],
|
|
66
|
+
'@typescript-eslint/strict-boolean-expressions': ['error'],
|
|
67
|
+
'@typescript-eslint/prefer-nullish-coalescing': ['error'],
|
|
68
|
+
'@typescript-eslint/prefer-optional-chain': ['error'],
|
|
69
|
+
'@typescript-eslint/explicit-module-boundary-types': ['error'],
|
|
70
|
+
'prefer-promise-reject-errors': ['error'],
|
|
71
|
+
'unicorn/prefer-string-slice': ['error'],
|
|
72
|
+
'@typescript-eslint/switch-exhaustiveness-check': ['error'],
|
|
73
|
+
'prefer-arrow/prefer-arrow-functions': ['error'],
|
|
74
|
+
'object-shorthand': ['error'],
|
|
75
|
+
'import/extensions': ['error', 'always', { ignorePackages: true }],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
ignores: ['eslint.config.js'],
|
|
80
|
+
},
|
|
81
|
+
)
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bifravst/eslint-config-typescript",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "ESLint config for all
|
|
5
|
-
"
|
|
3
|
+
"version": "6.0.0",
|
|
4
|
+
"description": "ESLint config for all our projects.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "eslint.config.js",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git+https://github.com/bifravst/eslint-config-typescript.git"
|
|
@@ -10,36 +11,28 @@
|
|
|
10
11
|
"bugs": {
|
|
11
12
|
"url": "https://github.com/bifravst/eslint-config-typescript/issues"
|
|
12
13
|
},
|
|
13
|
-
"homepage": "https://
|
|
14
|
+
"homepage": "https://github.com/bifravst/eslint-config-typescript#readme",
|
|
14
15
|
"keywords": [
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"Asset Tracker",
|
|
19
|
-
"NordicSemiconductor"
|
|
16
|
+
"eslint",
|
|
17
|
+
"typescript",
|
|
18
|
+
"typescript-eslint"
|
|
20
19
|
],
|
|
21
20
|
"author": "Nordic Semiconductor ASA | nordicsemi.no",
|
|
22
21
|
"license": "BSD-3-Clause",
|
|
23
22
|
"dependencies": {
|
|
24
|
-
"@typescript-eslint/eslint-plugin": "
|
|
25
|
-
"
|
|
26
|
-
"eslint-config-prettier": "
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "7.0.1",
|
|
24
|
+
"eslint": "8.56.0",
|
|
25
|
+
"eslint-config-prettier": "9.1.0",
|
|
26
|
+
"eslint-plugin-import": "2.29.1",
|
|
27
|
+
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
28
|
+
"eslint-plugin-unicorn": "51.0.1",
|
|
29
|
+
"typescript": "5.3.3",
|
|
30
|
+
"typescript-eslint": "7.0.1"
|
|
27
31
|
},
|
|
28
32
|
"devDependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"@commitlint/config-
|
|
31
|
-
"
|
|
32
|
-
"husky": "4.3.8",
|
|
33
|
-
"lint-staged": "10.5.3",
|
|
34
|
-
"prettier": "2.2.1",
|
|
35
|
-
"snyk": "1.437.4",
|
|
36
|
-
"typescript": "4.1.3"
|
|
37
|
-
},
|
|
38
|
-
"husky": {
|
|
39
|
-
"hooks": {
|
|
40
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
41
|
-
"pre-commit": "lint-staged"
|
|
42
|
-
}
|
|
33
|
+
"@bifravst/prettier-config": "1.0.0",
|
|
34
|
+
"@commitlint/config-conventional": "18.6.2",
|
|
35
|
+
"husky": "9.0.11"
|
|
43
36
|
},
|
|
44
37
|
"lint-staged": {
|
|
45
38
|
"*.{yml,md,js,json}": [
|
|
@@ -47,14 +40,26 @@
|
|
|
47
40
|
]
|
|
48
41
|
},
|
|
49
42
|
"engines": {
|
|
50
|
-
"node": ">=
|
|
51
|
-
"npm": ">=
|
|
43
|
+
"node": ">=20",
|
|
44
|
+
"npm": ">=9"
|
|
52
45
|
},
|
|
53
46
|
"release": {
|
|
54
47
|
"branches": [
|
|
55
48
|
"saga"
|
|
56
49
|
],
|
|
57
|
-
"remoteTags": true
|
|
50
|
+
"remoteTags": true,
|
|
51
|
+
"plugins": [
|
|
52
|
+
"@semantic-release/commit-analyzer",
|
|
53
|
+
"@semantic-release/release-notes-generator",
|
|
54
|
+
"@semantic-release/npm",
|
|
55
|
+
[
|
|
56
|
+
"@semantic-release/github",
|
|
57
|
+
{
|
|
58
|
+
"successComment": false,
|
|
59
|
+
"failTitle": false
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
]
|
|
58
63
|
},
|
|
59
64
|
"publishConfig": {
|
|
60
65
|
"access": "public"
|
|
@@ -66,9 +71,8 @@
|
|
|
66
71
|
"README.md"
|
|
67
72
|
],
|
|
68
73
|
"scripts": {
|
|
69
|
-
"
|
|
70
|
-
"prepare": "
|
|
71
|
-
"test": "eslint --ext .js,.ts,.tsx *.js"
|
|
74
|
+
"test": "eslint *.ts",
|
|
75
|
+
"prepare": "husky"
|
|
72
76
|
},
|
|
73
|
-
"
|
|
77
|
+
"prettier": "@bifravst/prettier-config"
|
|
74
78
|
}
|
package/index.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
parserOptions: {
|
|
4
|
-
project: './tsconfig.json',
|
|
5
|
-
},
|
|
6
|
-
plugins: ['@typescript-eslint'],
|
|
7
|
-
extends: [
|
|
8
|
-
'eslint:recommended',
|
|
9
|
-
'plugin:@typescript-eslint/recommended',
|
|
10
|
-
'prettier',
|
|
11
|
-
],
|
|
12
|
-
rules: {
|
|
13
|
-
'@typescript-eslint/indent': ['off'],
|
|
14
|
-
'@typescript-eslint/no-object-literal-type-assertion': ['off'],
|
|
15
|
-
'@typescript-eslint/explicit-function-return-type': ['off'],
|
|
16
|
-
'@typescript-eslint/await-thenable': ['error'],
|
|
17
|
-
'@typescript-eslint/no-extraneous-class': ['error'],
|
|
18
|
-
'@typescript-eslint/no-floating-promises': ['error'],
|
|
19
|
-
'@typescript-eslint/no-for-in-array': ['error'],
|
|
20
|
-
'@typescript-eslint/no-require-imports': ['error'],
|
|
21
|
-
'@typescript-eslint/no-this-alias': ['error'],
|
|
22
|
-
'@typescript-eslint/no-type-alias': ['off'],
|
|
23
|
-
'@typescript-eslint/no-unnecessary-type-assertion': ['error'],
|
|
24
|
-
'@typescript-eslint/no-useless-constructor': ['error'],
|
|
25
|
-
'@typescript-eslint/prefer-for-of': ['error'],
|
|
26
|
-
'@typescript-eslint/prefer-function-type': ['error'],
|
|
27
|
-
'@typescript-eslint/prefer-includes': ['error'],
|
|
28
|
-
'@typescript-eslint/prefer-readonly': ['error'],
|
|
29
|
-
'@typescript-eslint/prefer-regexp-exec': ['error'],
|
|
30
|
-
'@typescript-eslint/prefer-string-starts-ends-with': ['error'],
|
|
31
|
-
'@typescript-eslint/promise-function-async': ['error'],
|
|
32
|
-
'@typescript-eslint/require-array-sort-compare': ['error'],
|
|
33
|
-
'@typescript-eslint/restrict-plus-operands': ['error'],
|
|
34
|
-
semi: 'off',
|
|
35
|
-
'@typescript-eslint/semi': ['off'],
|
|
36
|
-
'@typescript-eslint/member-delimiter-style': [
|
|
37
|
-
'error',
|
|
38
|
-
{
|
|
39
|
-
multiline: {
|
|
40
|
-
delimiter: 'none',
|
|
41
|
-
requireLast: false,
|
|
42
|
-
},
|
|
43
|
-
singleline: {
|
|
44
|
-
delimiter: 'semi',
|
|
45
|
-
requireLast: false,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
'@typescript-eslint/prefer-interface': ['off'],
|
|
50
|
-
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
51
|
-
'@typescript-eslint/no-explicit-any': ['off'],
|
|
52
|
-
'no-console': ['off'],
|
|
53
|
-
'@typescript-eslint/strict-boolean-expressions': ['error'],
|
|
54
|
-
'@typescript-eslint/prefer-nullish-coalescing': ['error'],
|
|
55
|
-
'@typescript-eslint/prefer-optional-chain': ['error'],
|
|
56
|
-
'@typescript-eslint/explicit-module-boundary-types': ['error'],
|
|
57
|
-
},
|
|
58
|
-
env: {
|
|
59
|
-
browser: true,
|
|
60
|
-
amd: true,
|
|
61
|
-
node: true,
|
|
62
|
-
},
|
|
63
|
-
}
|