eslint-plugin-power-esrules 0.1.3 → 0.1.5
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.
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
const path = require("path");
|
|
13
13
|
|
|
14
|
+
const packetName = "power-linter";
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* Проверяет, является ли класс React компонентом
|
|
16
18
|
*/
|
|
@@ -182,7 +184,7 @@ module.exports = {
|
|
|
182
184
|
messages: {
|
|
183
185
|
shouldConvertToFunctional:
|
|
184
186
|
'Классовый компонент "{{componentName}}" подходит для конвертации в функциональный. ' +
|
|
185
|
-
|
|
187
|
+
`Запустите:node node_modules/${packetName}/scripts/classToFC/run-codemod.js {{filePath}}`,
|
|
186
188
|
},
|
|
187
189
|
},
|
|
188
190
|
|
|
@@ -38,18 +38,20 @@ function getImportType(node) {
|
|
|
38
38
|
|
|
39
39
|
// Сторонние библиотеки (не относительные и не начинаются с внутренних путей)
|
|
40
40
|
const internalPathPatterns = [
|
|
41
|
-
/^components
|
|
42
|
-
/^utils
|
|
43
|
-
/^modules
|
|
44
|
-
/^pages
|
|
45
|
-
/^services
|
|
46
|
-
/^store
|
|
47
|
-
/^types
|
|
48
|
-
/^constants
|
|
49
|
-
/^hooks
|
|
50
|
-
/^helpers
|
|
51
|
-
/^selectors
|
|
52
|
-
/^base
|
|
41
|
+
/^components/,
|
|
42
|
+
/^utils/,
|
|
43
|
+
/^modules/,
|
|
44
|
+
/^pages/,
|
|
45
|
+
/^services/,
|
|
46
|
+
/^store/,
|
|
47
|
+
/^types/,
|
|
48
|
+
/^constants/,
|
|
49
|
+
/^hooks/,
|
|
50
|
+
/^helpers/,
|
|
51
|
+
/^selectors/,
|
|
52
|
+
/^base/,
|
|
53
|
+
/^actions/,
|
|
54
|
+
/^containers/,
|
|
53
55
|
];
|
|
54
56
|
const isInternalPath = internalPathPatterns.some((pattern) =>
|
|
55
57
|
pattern.test(source)
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
const path = require("path");
|
|
9
9
|
|
|
10
|
+
const packetName = "power-linter";
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* Получает имя JSX элемента
|
|
12
14
|
*/
|
|
@@ -131,8 +133,8 @@ module.exports = {
|
|
|
131
133
|
messages: {
|
|
132
134
|
missingDataTestId:
|
|
133
135
|
"Корневой контейнер JSX не содержит атрибут data-testid. " +
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
`Запустите: node node_modules/${packetName}/scripts/addDataTestId/run-codemod.js {{filePath}}` +
|
|
137
|
+
` или node node_modules/${packetName}/scripts/addDataTestId/run-codemod.js src для всего проекта`,
|
|
136
138
|
},
|
|
137
139
|
},
|
|
138
140
|
|