@rsdk/eslint-plugin 3.0.2
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/CHANGELOG.md +135 -0
- package/index.js +142 -0
- package/package.json +24 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [3.0.2](https://github.com/R-Vision/rsdk/compare/v3.0.1...v3.0.2) (2023-08-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rsdk/eslint-plugin
|
|
9
|
+
|
|
10
|
+
## [3.0.0](https://github.com/R-Vision/rsdk/compare/v3.0.0-next.0...v3.0.0) (2023-08-04)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @rsdk/eslint-plugin
|
|
13
|
+
|
|
14
|
+
# [2.6.0-next.15](https://github.com/R-Vision/rsdk/compare/v2.6.0-next.14...v2.6.0-next.15) (2023-08-04)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @rsdk/eslint-plugin
|
|
17
|
+
|
|
18
|
+
# [2.6.0-next.13](https://github.com/R-Vision/rsdk/compare/v2.6.0-next.12...v2.6.0-next.13) (2023-08-01)
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **db.knex:** listener leak ([#82](https://github.com/R-Vision/rsdk/issues/82)) ([791cf15](https://github.com/R-Vision/rsdk/commit/791cf1556951878027d3e9824ed92a5690669895))
|
|
23
|
+
|
|
24
|
+
# [2.6.0-next.3](https://github.com/R-Vision/rsdk/compare/v2.6.0-next.2...v2.6.0-next.3) (2023-07-07)
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* add data-source extractor from PlatformApp ([#76](https://github.com/R-Vision/rsdk/issues/76)) ([c668f12](https://github.com/R-Vision/rsdk/commit/c668f12142a009ac7c4bc5adc84b6fa8b85d413a))
|
|
29
|
+
|
|
30
|
+
# [2.5.0](https://github.com/R-Vision/rsdk/compare/v2.4.4-next.0...v2.5.0) (2023-06-23)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @rsdk/eslint-plugin
|
|
33
|
+
|
|
34
|
+
## [2.4.4-next.0](https://github.com/R-Vision/rsdk/compare/v2.4.3...v2.4.4-next.0) (2023-06-22)
|
|
35
|
+
|
|
36
|
+
**Note:** Version bump only for package @rsdk/eslint-plugin
|
|
37
|
+
|
|
38
|
+
## [2.4.3](https://github.com/R-Vision/rsdk/compare/v2.4.3-next.0...v2.4.3) (2023-06-21)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @rsdk/eslint-plugin
|
|
41
|
+
|
|
42
|
+
## [2.4.3-next.0](https://github.com/R-Vision/rsdk/compare/v2.4.2...v2.4.3-next.0) (2023-06-21)
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* **deps:** remove unused dependencies ([4512c78](https://github.com/R-Vision/rsdk/commit/4512c7891f806dd1cd88275cb89c5fa381eb9917))
|
|
47
|
+
|
|
48
|
+
## [2.4.2](https://github.com/R-Vision/rsdk/compare/v2.4.2-next.0...v2.4.2) (2023-06-16)
|
|
49
|
+
|
|
50
|
+
**Note:** Version bump only for package @rsdk/eslint-plugin
|
|
51
|
+
|
|
52
|
+
## [2.4.2-next.0](https://github.com/R-Vision/rsdk/compare/v2.4.1...v2.4.2-next.0) (2023-06-15)
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* **eslint-plugin:** eslint-plugin-unicorn in deps ([cfad3f1](https://github.com/R-Vision/rsdk/commit/cfad3f164d7da6e02b17ec7af539c26a58cb027c))
|
|
57
|
+
* **eslint-plugin:** normalize tsconfig.lint.json ([25d77cd](https://github.com/R-Vision/rsdk/commit/25d77cd69206fa6e1c79ba6ae27ee89276b0cfa2))
|
|
58
|
+
|
|
59
|
+
## [2.4.1](https://github.com/R-Vision/rsdk/compare/v2.4.1-next.2...v2.4.1) (2023-06-15)
|
|
60
|
+
|
|
61
|
+
**Note:** Version bump only for package @rsdk/eslint-plugin
|
|
62
|
+
|
|
63
|
+
## [2.4.1-next.2](https://github.com/R-Vision/rsdk/compare/v2.4.1-next.1...v2.4.1-next.2) (2023-06-15)
|
|
64
|
+
|
|
65
|
+
**Note:** Version bump only for package @rsdk/eslint-plugin
|
|
66
|
+
|
|
67
|
+
## [2.4.1-next.0](https://github.com/R-Vision/rsdk/compare/v2.4.0...v2.4.1-next.0) (2023-06-15)
|
|
68
|
+
|
|
69
|
+
**Note:** Version bump only for package @rsdk/eslint-plugin
|
|
70
|
+
|
|
71
|
+
# [2.4.0](https://github.com/R-Vision/rsdk/compare/v2.3.1...v2.4.0) (2023-06-15)
|
|
72
|
+
|
|
73
|
+
### Features
|
|
74
|
+
|
|
75
|
+
* change publish config for eslint-plugin, prettier-config, tsconfig ([def7140](https://github.com/R-Vision/rsdk/commit/def714063af0236f35a4290ffc168af4d4037247))
|
|
76
|
+
|
|
77
|
+
# [2.0.0](https://github.com/R-Vision/rsdk/compare/v1.0.12...v2.0.0) (2023-06-06)
|
|
78
|
+
|
|
79
|
+
### Features
|
|
80
|
+
|
|
81
|
+
* eslint-config -> eslint-plugin ([#32](https://github.com/R-Vision/rsdk/issues/32)) ([6a11df8](https://github.com/R-Vision/rsdk/commit/6a11df864cb9710034a95bac2729aedbea3216bf))
|
|
82
|
+
|
|
83
|
+
## 1.0.12 (2023-05-23)
|
|
84
|
+
|
|
85
|
+
### Bug Fixes
|
|
86
|
+
|
|
87
|
+
* remove private dependencies from `peerDependencies` section ([0bce6ff](https://github.com/R-Vision/rsdk/commit/0bce6ffb5b699e2ed1dc9aca77cbdbf085267ff7))
|
|
88
|
+
|
|
89
|
+
## 1.0.11 (2023-05-23)
|
|
90
|
+
|
|
91
|
+
**Note:** Version bump only for package eslint-config-rsdk
|
|
92
|
+
|
|
93
|
+
## 1.0.10 (2023-05-22)
|
|
94
|
+
|
|
95
|
+
### Bug Fixes
|
|
96
|
+
|
|
97
|
+
* add "access: public" to new packages ([04d5983](https://github.com/R-Vision/rsdk/commit/04d5983cfa3e97c5d8219e07208a0499a8c6bc83))
|
|
98
|
+
|
|
99
|
+
## 1.0.9 (2023-05-21)
|
|
100
|
+
|
|
101
|
+
**Note:** Version bump only for package eslint-config-rsdk
|
|
102
|
+
|
|
103
|
+
## 1.0.8 (2023-05-17)
|
|
104
|
+
|
|
105
|
+
**Note:** Version bump only for package eslint-config-rsdk
|
|
106
|
+
|
|
107
|
+
## 1.0.7 (2023-05-11)
|
|
108
|
+
|
|
109
|
+
**Note:** Version bump only for package eslint-config-rsdk
|
|
110
|
+
|
|
111
|
+
## 1.0.6 (2023-05-11)
|
|
112
|
+
|
|
113
|
+
**Note:** Version bump only for package eslint-config-rsdk
|
|
114
|
+
|
|
115
|
+
## 1.0.5 (2023-05-10)
|
|
116
|
+
|
|
117
|
+
**Note:** Version bump only for package eslint-config-rsdk
|
|
118
|
+
|
|
119
|
+
## 1.0.4 (2023-05-10)
|
|
120
|
+
|
|
121
|
+
**Note:** Version bump only for package eslint-config-rsdk
|
|
122
|
+
|
|
123
|
+
## 1.0.3 (2023-05-10)
|
|
124
|
+
|
|
125
|
+
### Bug Fixes
|
|
126
|
+
|
|
127
|
+
* builtin make not private in npm ([50c83b6](https://github.com/R-Vision/rsdk/commit/50c83b6454f9a89f1e99d3b33a497ce2c029d8c6))
|
|
128
|
+
|
|
129
|
+
## 1.0.2 (2023-05-10)
|
|
130
|
+
|
|
131
|
+
**Note:** Version bump only for package eslint-config-rsdk
|
|
132
|
+
|
|
133
|
+
## 1.0.1 (2023-05-07)
|
|
134
|
+
|
|
135
|
+
**Note:** Version bump only for package eslint-config-rsdk
|
package/index.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
configs: {
|
|
3
|
+
recommended: {
|
|
4
|
+
parser: '@typescript-eslint/parser',
|
|
5
|
+
parserOptions: {
|
|
6
|
+
// Не стоит писать сюда project: 'tsconfig.json`, это ломает работу eslint
|
|
7
|
+
// В ряде случаев он просто отрабатывает не так как надо, а в некоторых просто падает
|
|
8
|
+
project: true,
|
|
9
|
+
sourceType: 'module',
|
|
10
|
+
ecmaVersion: 2020,
|
|
11
|
+
},
|
|
12
|
+
plugins: [
|
|
13
|
+
'@typescript-eslint/eslint-plugin',
|
|
14
|
+
'simple-import-sort',
|
|
15
|
+
'import',
|
|
16
|
+
'unicorn',
|
|
17
|
+
],
|
|
18
|
+
extends: [
|
|
19
|
+
'plugin:@typescript-eslint/eslint-recommended',
|
|
20
|
+
// FIXME не уверен что его стоит добавлять, но посмотреть в целом стоит
|
|
21
|
+
// 'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
22
|
+
'plugin:@typescript-eslint/recommended',
|
|
23
|
+
'plugin:import/typescript',
|
|
24
|
+
'plugin:prettier/recommended',
|
|
25
|
+
'plugin:unicorn/all',
|
|
26
|
+
],
|
|
27
|
+
root: true,
|
|
28
|
+
env: {
|
|
29
|
+
node: true,
|
|
30
|
+
jest: true,
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
'@typescript-eslint/interface-name-prefix': 'off',
|
|
34
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
35
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
36
|
+
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
37
|
+
'import/no-extraneous-dependencies': [
|
|
38
|
+
'error',
|
|
39
|
+
{
|
|
40
|
+
devDependencies: [
|
|
41
|
+
'**/*.test.ts',
|
|
42
|
+
'**/*.spec.ts',
|
|
43
|
+
'**/*.test.e2e.ts',
|
|
44
|
+
'**/*.spec.e2e.ts',
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
49
|
+
'@typescript-eslint/member-ordering': 'error',
|
|
50
|
+
'@typescript-eslint/lines-between-class-members': [
|
|
51
|
+
'warn',
|
|
52
|
+
'always',
|
|
53
|
+
{
|
|
54
|
+
exceptAfterSingleLine: true,
|
|
55
|
+
exceptAfterOverload: true,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
'@typescript-eslint/padding-line-between-statements': [
|
|
59
|
+
'warn',
|
|
60
|
+
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
|
|
61
|
+
{
|
|
62
|
+
blankLine: 'any',
|
|
63
|
+
prev: ['const', 'let', 'var'],
|
|
64
|
+
next: ['const', 'let', 'var', 'if'],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
// Конфликтует с преттиером
|
|
68
|
+
// 'lines-around-comment': 'error',
|
|
69
|
+
'import/no-cycle': 'error',
|
|
70
|
+
'import/first': 'error',
|
|
71
|
+
'import/newline-after-import': 'error',
|
|
72
|
+
'import/no-duplicates': 'error',
|
|
73
|
+
'sort-imports': 'off',
|
|
74
|
+
'simple-import-sort/imports': [
|
|
75
|
+
'error',
|
|
76
|
+
{
|
|
77
|
+
groups: [
|
|
78
|
+
// Node.js builtins. You could also generate this regex if you use a `.js` config.
|
|
79
|
+
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
|
|
80
|
+
[
|
|
81
|
+
'^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)',
|
|
82
|
+
],
|
|
83
|
+
// Packages. `react` related packages come first.
|
|
84
|
+
['^react', '^@?\\w'],
|
|
85
|
+
// Internal packages.
|
|
86
|
+
['^(@|@company|@ui|components|utils|config|vendored-lib)(/.*|$)'],
|
|
87
|
+
// Side effect imports.
|
|
88
|
+
['^\\u0000'],
|
|
89
|
+
// Parent imports. Put `..` last.
|
|
90
|
+
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
91
|
+
// Other relative imports. Put same-folder imports and `.` last.
|
|
92
|
+
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
|
93
|
+
// Style imports.
|
|
94
|
+
['^.+\\.s?css$'],
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
'@typescript-eslint/naming-convention': [
|
|
99
|
+
'error',
|
|
100
|
+
{
|
|
101
|
+
selector: ['classMethod', 'accessor', 'parameterProperty'],
|
|
102
|
+
format: ['camelCase'],
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
|
|
106
|
+
// unicorn
|
|
107
|
+
'unicorn/custom-error-definition': 'off',
|
|
108
|
+
// Очень странная мотивация у этого правила, у меня может быть метод который подсчитывает количество товаров в заказе и собственно массив заказов
|
|
109
|
+
'unicorn/no-array-callback-reference': 'off',
|
|
110
|
+
// просто спорное правило
|
|
111
|
+
'unicorn/no-array-reduce': 'off',
|
|
112
|
+
'unicorn/no-keyword-prefix': 'off',
|
|
113
|
+
'no-negated-condition': 'off',
|
|
114
|
+
'no-nested-ternary': 'off',
|
|
115
|
+
// глупость, так как null хотя бы является валидным сериализуемым значением
|
|
116
|
+
'unicorn/no-null': 'off',
|
|
117
|
+
// Как правило, удобнее сгруппировать методы в namespace
|
|
118
|
+
'unicorn/no-static-only-class': 'off',
|
|
119
|
+
// дублирует правило @typescript-eslint/no-this-alias
|
|
120
|
+
'unicorn/no-this-assignment': 'off',
|
|
121
|
+
// портит regex например /\/?([\w\-_]+:[\w\-_]+)$/gi.exec(tag)?.[1]
|
|
122
|
+
'unicorn/better-regex': 'off',
|
|
123
|
+
'unicorn/no-unused-properties': 'off',
|
|
124
|
+
// Пытался как-то консистентно эту историю организовать, но это около невозможно потому что порты например нет смысла делить
|
|
125
|
+
'unicorn/numeric-separators-style': 'off',
|
|
126
|
+
'unicorn/prefer-json-parse-buffer': 'error',
|
|
127
|
+
// пока мы не переехали на esm смысла нет
|
|
128
|
+
'unicorn/prefer-module': 'off',
|
|
129
|
+
// мешает делать typeguard `(var: MyInterface | undefined): var is MyInterface => Boolean(var)`
|
|
130
|
+
'unicorn/prefer-native-coercion-functions': 'off',
|
|
131
|
+
// иногда проще делать Array.from, а там где `spread` лучше, там и так понятно
|
|
132
|
+
'unicorn/prefer-spread': 'off',
|
|
133
|
+
// не нашёл гибкой конфигурации чтобы он не ругался на `param` например
|
|
134
|
+
'unicorn/prevent-abbreviations': 'off',
|
|
135
|
+
// мешает делать case: return some(a, b, c)
|
|
136
|
+
'unicorn/switch-case-braces': ['error', 'avoid'],
|
|
137
|
+
// некорректный парсинг, ругается на любой вызов метода find
|
|
138
|
+
'unicorn/no-array-method-this-argument': 'off',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rsdk/eslint-plugin",
|
|
3
|
+
"version": "3.0.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"license": "Apache License 2.0",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@typescript-eslint/eslint-plugin": "^5.59.5",
|
|
12
|
+
"@typescript-eslint/parser": "^5.59.5",
|
|
13
|
+
"eslint-config-prettier": "^8.8.0",
|
|
14
|
+
"eslint-formatter-codeframe": "^7.32.1",
|
|
15
|
+
"eslint-plugin-import": "^2.27.5",
|
|
16
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
17
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
18
|
+
"eslint-plugin-unicorn": "^47.0.0"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"eslint": "^8.40.0"
|
|
22
|
+
},
|
|
23
|
+
"gitHead": "3ee33710bf18bfadf87a6da92b060e6a17481110"
|
|
24
|
+
}
|