@scality/core-ui 0.206.0 → 0.207.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/jest.config.js +5 -0
- package/package.json +2 -3
- package/src/lib/valalint/index.mjs +49 -0
- package/src/lib/valalint/rules/modal-button-forbidden-label.test.js +1 -1
- package/src/lib/valalint/rules/no-raw-number-in-jsx.test.js +1 -1
- package/src/lib/valalint/rules/technical-sentence-case.test.js +1 -1
- package/src/lib/valalint/index.js +0 -49
- /package/src/lib/valalint/rules/{modal-button-forbidden-label.js → modal-button-forbidden-label.mjs} +0 -0
- /package/src/lib/valalint/rules/{no-raw-number-in-jsx.js → no-raw-number-in-jsx.mjs} +0 -0
- /package/src/lib/valalint/rules/{technical-sentence-case.js → technical-sentence-case.mjs} +0 -0
package/jest.config.js
CHANGED
|
@@ -10,5 +10,10 @@ export default {
|
|
|
10
10
|
'^@fortawesome/free-regular-svg-icons/(.+)\\.js$':
|
|
11
11
|
'@fortawesome/free-regular-svg-icons/$1',
|
|
12
12
|
},
|
|
13
|
+
// Transform both .js and .mjs files with Babel
|
|
14
|
+
transform: {
|
|
15
|
+
'^.+\\.(js|jsx|mjs)$': 'babel-jest',
|
|
16
|
+
'^.+\\.(ts|tsx)$': 'babel-jest',
|
|
17
|
+
},
|
|
13
18
|
testEnvironment: 'jsdom',
|
|
14
19
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scality/core-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.207.0",
|
|
4
4
|
"description": "Scality common React component library",
|
|
5
5
|
"author": "Scality Engineering",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
|
-
"type": "module",
|
|
9
8
|
"types": "dist/index.d.ts",
|
|
10
9
|
"mainSrc": "src/lib/index.js",
|
|
11
10
|
"exports": {
|
|
@@ -14,7 +13,7 @@
|
|
|
14
13
|
"require": "./dist/index.js",
|
|
15
14
|
"types": "./dist/index.d.ts"
|
|
16
15
|
},
|
|
17
|
-
"./eslint-plugin": "./src/lib/valalint/index.
|
|
16
|
+
"./eslint-plugin": "./src/lib/valalint/index.mjs",
|
|
18
17
|
"./dist/*.css": "./dist/*.css",
|
|
19
18
|
"./dist/*": "./dist/*"
|
|
20
19
|
},
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import tsParser from "@typescript-eslint/parser";
|
|
2
|
+
import modalButtonForbiddenLabel from "./rules/modal-button-forbidden-label.mjs";
|
|
3
|
+
import noRawNumberInJsx from "./rules/no-raw-number-in-jsx.mjs";
|
|
4
|
+
import technicalSentenceCase from "./rules/technical-sentence-case.mjs";
|
|
5
|
+
|
|
6
|
+
const rules = {
|
|
7
|
+
"technical-sentence-case": technicalSentenceCase,
|
|
8
|
+
"modal-button-forbidden-label": modalButtonForbiddenLabel,
|
|
9
|
+
"no-raw-number-in-jsx": noRawNumberInJsx,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** Default rule severity for the recommended config. */
|
|
13
|
+
const recommendedRules = {
|
|
14
|
+
"valalint/technical-sentence-case": "warn",
|
|
15
|
+
"valalint/modal-button-forbidden-label": "warn",
|
|
16
|
+
"valalint/no-raw-number-in-jsx": "warn",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const plugin = {
|
|
20
|
+
meta: {
|
|
21
|
+
name: "valalint",
|
|
22
|
+
version: "1.0.0",
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
rules,
|
|
26
|
+
configs: {
|
|
27
|
+
/** Legacy eslintrc-style recommended config. */
|
|
28
|
+
recommended: {
|
|
29
|
+
plugins: ["valalint"],
|
|
30
|
+
rules: recommendedRules,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
plugin.configs["flat/recommended"] = {
|
|
36
|
+
plugins: { valalint: plugin },
|
|
37
|
+
rules: recommendedRules,
|
|
38
|
+
languageOptions: {
|
|
39
|
+
parser: tsParser,
|
|
40
|
+
parserOptions: {
|
|
41
|
+
ecmaFeatures: {
|
|
42
|
+
jsx: true,
|
|
43
|
+
},
|
|
44
|
+
project: true,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default plugin;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment node
|
|
3
3
|
*/
|
|
4
4
|
import { RuleTester } from '@typescript-eslint/rule-tester';
|
|
5
|
-
import rule from './no-raw-number-in-jsx.
|
|
5
|
+
import rule from './no-raw-number-in-jsx.mjs';
|
|
6
6
|
import path from 'path';
|
|
7
7
|
|
|
8
8
|
// Jest runs from the project root, so process.cwd() is the workspace root
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import tsParser from '@typescript-eslint/parser';
|
|
2
|
-
import technicalSentenceCase from './rules/technical-sentence-case.js';
|
|
3
|
-
import modalButtonForbiddenLabel from './rules/modal-button-forbidden-label.js';
|
|
4
|
-
import noRawNumberInJsx from './rules/no-raw-number-in-jsx.js';
|
|
5
|
-
|
|
6
|
-
const rules = {
|
|
7
|
-
'technical-sentence-case': technicalSentenceCase,
|
|
8
|
-
'modal-button-forbidden-label': modalButtonForbiddenLabel,
|
|
9
|
-
'no-raw-number-in-jsx': noRawNumberInJsx,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/** Default rule severity for the recommended config. */
|
|
13
|
-
const recommendedRules = {
|
|
14
|
-
'valalint/technical-sentence-case': 'warn',
|
|
15
|
-
'valalint/modal-button-forbidden-label': 'warn',
|
|
16
|
-
'valalint/no-raw-number-in-jsx': 'warn',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const plugin = {
|
|
20
|
-
meta: {
|
|
21
|
-
name: 'valalint',
|
|
22
|
-
version: '1.0.0',
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
rules,
|
|
26
|
-
configs: {
|
|
27
|
-
/** Legacy eslintrc-style recommended config. */
|
|
28
|
-
recommended: {
|
|
29
|
-
plugins: ['valalint'],
|
|
30
|
-
rules: recommendedRules,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
plugin.configs['flat/recommended'] = {
|
|
36
|
-
plugins: { valalint: plugin },
|
|
37
|
-
rules: recommendedRules,
|
|
38
|
-
languageOptions: {
|
|
39
|
-
parser: tsParser,
|
|
40
|
-
parserOptions: {
|
|
41
|
-
ecmaFeatures: {
|
|
42
|
-
jsx: true,
|
|
43
|
-
},
|
|
44
|
-
project: true,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default plugin;
|
/package/src/lib/valalint/rules/{modal-button-forbidden-label.js → modal-button-forbidden-label.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|