chayns-toolkit 3.0.12 → 3.0.14
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 +21 -21
- package/README.md +88 -88
- package/cli.js +2 -2
- package/eslint/index.js +65 -65
- package/eslint/javascriptRules.js +8 -8
- package/eslint/sharedRules.js +32 -32
- package/eslint/typescriptRules.js +20 -20
- package/lib/assets/react-testing-library.setup.js +2 -2
- package/lib/cli.js +20 -20
- package/package.json +2 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Tobit Software Laboratories AG
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Tobit Software Laboratories AG
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<a href="https://tobitsoftware.github.io/chayns-toolkit/" target="_blank">
|
|
3
|
-
<h1 align="center">
|
|
4
|
-
<img src="https://raw.githubusercontent.com/TobitSoftware/chayns-toolkit/HEAD/assets/logo.png" width="500px" alt="chayns-toolkit" />
|
|
5
|
-
</h1>
|
|
6
|
-
</a>
|
|
7
|
-
<p align="center">A zero-config toolchain for developing chayns® apps.</p>
|
|
8
|
-
<p align="center">
|
|
9
|
-
<a href="https://github.com/TobitSoftware/chayns-toolkit/blob/master/LICENSE" target="_blank">
|
|
10
|
-
<img src="https://img.shields.io/github/license/TobitSoftware/chayns-toolkit?color=%23A855F7&labelColor=%2327272A&style=for-the-badge" alt="" />
|
|
11
|
-
</a>
|
|
12
|
-
<a href="https://www.npmjs.com/package/chayns-toolkit" target="_blank">
|
|
13
|
-
<img src="https://img.shields.io/npm/v/chayns-toolkit?color=%236366F1&labelColor=%2327272A&style=for-the-badge" alt="" />
|
|
14
|
-
</a>
|
|
15
|
-
<a href="https://github.com/TobitSoftware/chayns-toolkit/branches" target="_blank">
|
|
16
|
-
<img src="https://img.shields.io/github/last-commit/TobitSoftware/chayns-toolkit?color=%2310B981&labelColor=%2327272A&style=for-the-badge" alt="" />
|
|
17
|
-
</a>
|
|
18
|
-
</p>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
**chayns-toolkit** contains pre-configured tools for the development, publishing and quality
|
|
24
|
-
assurance of your app. It was created to simplify the development experience when working with
|
|
25
|
-
[React](https://reactjs.org).
|
|
26
|
-
|
|
27
|
-
> This toolchain is specialized in developing apps and plugins for the
|
|
28
|
-
> [chayns®](https://chayns.org/) platform. If you want to develop a general purpose web app, take a
|
|
29
|
-
> look at [Next.js](https://nextjs.org/). <br>
|
|
30
|
-
|
|
31
|
-
<br>
|
|
32
|
-
|
|
33
|
-
## ❯ Getting Started
|
|
34
|
-
|
|
35
|
-
For the easiest way to start a new chayns® project with chayns-toolkit check out
|
|
36
|
-
[`create-chayns-app`](https://github.com/TobitSoftware/create-chayns-app).
|
|
37
|
-
|
|
38
|
-
<br>
|
|
39
|
-
|
|
40
|
-
## ❯ Documentation
|
|
41
|
-
|
|
42
|
-
Visit
|
|
43
|
-
[https://tobitsoftware.github.io/chayns-toolkit/](https://tobitsoftware.github.io/chayns-toolkit/)
|
|
44
|
-
to view the full documentation.
|
|
45
|
-
|
|
46
|
-
<br>
|
|
47
|
-
|
|
48
|
-
## ❯ Migration v2 to v3
|
|
49
|
-
|
|
50
|
-
The chayns-toolkit moved RsBuild instead of webpack in this version. This means customizing the
|
|
51
|
-
config has changed significantly.
|
|
52
|
-
|
|
53
|
-
- **output.apiVersion** has been removed
|
|
54
|
-
- **remoteEntry.js** has been renamed to **v2.remoteEntry.js**
|
|
55
|
-
- **output.serverSideRendering** has been added. This creates a build to use for modules in SSR.
|
|
56
|
-
- Creates two subdirectories in build directory for client- and server-build.
|
|
57
|
-
- dotenv-Files will be automatically loaded now depending on the current NODE_ENV/BUILD_ENV
|
|
58
|
-
- Only variables which start with PUBLIC\_ are passed to the javascript context. Other
|
|
59
|
-
variables are only available in the toolkit.config.js to customize the config
|
|
60
|
-
- Not defined environment-variables are not replaced by RsBuild which can cause errors (webpack
|
|
61
|
-
replaced them with empty string)
|
|
62
|
-
- **output.entryPoints** has been added and changes how to configure the entry points of the
|
|
63
|
-
application
|
|
64
|
-
[https://tobitsoftware.github.io/chayns-toolkit/docs/configuration/output](https://tobitsoftware.github.io/chayns-toolkit/docs/configuration/output)
|
|
65
|
-
|
|
66
|
-
## ❯ Contributing
|
|
67
|
-
|
|
68
|
-
Please see our
|
|
69
|
-
[contributing document](https://tobitsoftware.github.io/chayns-toolkit/docs/contributing).
|
|
70
|
-
|
|
71
|
-
<br>
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
<p align="center">
|
|
76
|
-
<sub>
|
|
77
|
-
Project created by Leo Driesch at Tobit.Software.
|
|
78
|
-
</sub>
|
|
79
|
-
</p>
|
|
80
|
-
<p align="center">
|
|
81
|
-
<a href="https://labs.tobit.com/">
|
|
82
|
-
<img alt="Tobit.Software homepage" src="./assets/icons/globe.svg">
|
|
83
|
-
</a>
|
|
84
|
-
|
|
85
|
-
<a href="https://github.com/TobitSoftware">
|
|
86
|
-
<img alt="Tobit.Software on GitHub" src="./assets/icons/github.svg">
|
|
87
|
-
</a>
|
|
88
|
-
</p>
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://tobitsoftware.github.io/chayns-toolkit/" target="_blank">
|
|
3
|
+
<h1 align="center">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/TobitSoftware/chayns-toolkit/HEAD/assets/logo.png" width="500px" alt="chayns-toolkit" />
|
|
5
|
+
</h1>
|
|
6
|
+
</a>
|
|
7
|
+
<p align="center">A zero-config toolchain for developing chayns® apps.</p>
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://github.com/TobitSoftware/chayns-toolkit/blob/master/LICENSE" target="_blank">
|
|
10
|
+
<img src="https://img.shields.io/github/license/TobitSoftware/chayns-toolkit?color=%23A855F7&labelColor=%2327272A&style=for-the-badge" alt="" />
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/chayns-toolkit" target="_blank">
|
|
13
|
+
<img src="https://img.shields.io/npm/v/chayns-toolkit?color=%236366F1&labelColor=%2327272A&style=for-the-badge" alt="" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://github.com/TobitSoftware/chayns-toolkit/branches" target="_blank">
|
|
16
|
+
<img src="https://img.shields.io/github/last-commit/TobitSoftware/chayns-toolkit?color=%2310B981&labelColor=%2327272A&style=for-the-badge" alt="" />
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
**chayns-toolkit** contains pre-configured tools for the development, publishing and quality
|
|
24
|
+
assurance of your app. It was created to simplify the development experience when working with
|
|
25
|
+
[React](https://reactjs.org).
|
|
26
|
+
|
|
27
|
+
> This toolchain is specialized in developing apps and plugins for the
|
|
28
|
+
> [chayns®](https://chayns.org/) platform. If you want to develop a general purpose web app, take a
|
|
29
|
+
> look at [Next.js](https://nextjs.org/). <br>
|
|
30
|
+
|
|
31
|
+
<br>
|
|
32
|
+
|
|
33
|
+
## ❯ Getting Started
|
|
34
|
+
|
|
35
|
+
For the easiest way to start a new chayns® project with chayns-toolkit check out
|
|
36
|
+
[`create-chayns-app`](https://github.com/TobitSoftware/create-chayns-app).
|
|
37
|
+
|
|
38
|
+
<br>
|
|
39
|
+
|
|
40
|
+
## ❯ Documentation
|
|
41
|
+
|
|
42
|
+
Visit
|
|
43
|
+
[https://tobitsoftware.github.io/chayns-toolkit/](https://tobitsoftware.github.io/chayns-toolkit/)
|
|
44
|
+
to view the full documentation.
|
|
45
|
+
|
|
46
|
+
<br>
|
|
47
|
+
|
|
48
|
+
## ❯ Migration v2 to v3
|
|
49
|
+
|
|
50
|
+
The chayns-toolkit moved RsBuild instead of webpack in this version. This means customizing the
|
|
51
|
+
config has changed significantly.
|
|
52
|
+
|
|
53
|
+
- **output.apiVersion** has been removed
|
|
54
|
+
- **remoteEntry.js** has been renamed to **v2.remoteEntry.js**
|
|
55
|
+
- **output.serverSideRendering** has been added. This creates a build to use for modules in SSR.
|
|
56
|
+
- Creates two subdirectories in build directory for client- and server-build.
|
|
57
|
+
- dotenv-Files will be automatically loaded now depending on the current NODE_ENV/BUILD_ENV
|
|
58
|
+
- Only variables which start with PUBLIC\_ are passed to the javascript context. Other
|
|
59
|
+
variables are only available in the toolkit.config.js to customize the config
|
|
60
|
+
- Not defined environment-variables are not replaced by RsBuild which can cause errors (webpack
|
|
61
|
+
replaced them with empty string)
|
|
62
|
+
- **output.entryPoints** has been added and changes how to configure the entry points of the
|
|
63
|
+
application
|
|
64
|
+
[https://tobitsoftware.github.io/chayns-toolkit/docs/configuration/output](https://tobitsoftware.github.io/chayns-toolkit/docs/configuration/output)
|
|
65
|
+
|
|
66
|
+
## ❯ Contributing
|
|
67
|
+
|
|
68
|
+
Please see our
|
|
69
|
+
[contributing document](https://tobitsoftware.github.io/chayns-toolkit/docs/contributing).
|
|
70
|
+
|
|
71
|
+
<br>
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
<p align="center">
|
|
76
|
+
<sub>
|
|
77
|
+
Project created by Leo Driesch at Tobit.Software.
|
|
78
|
+
</sub>
|
|
79
|
+
</p>
|
|
80
|
+
<p align="center">
|
|
81
|
+
<a href="https://labs.tobit.com/">
|
|
82
|
+
<img alt="Tobit.Software homepage" src="./assets/icons/globe.svg">
|
|
83
|
+
</a>
|
|
84
|
+
|
|
85
|
+
<a href="https://github.com/TobitSoftware">
|
|
86
|
+
<img alt="Tobit.Software on GitHub" src="./assets/icons/github.svg">
|
|
87
|
+
</a>
|
|
88
|
+
</p>
|
package/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
|
|
3
|
-
require("./lib/cli.js")
|
|
2
|
+
|
|
3
|
+
require("./lib/cli.js")
|
package/eslint/index.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
const path = require("path")
|
|
2
|
-
const javascriptRules = require("./javascriptRules")
|
|
3
|
-
const sharedRules = require("./sharedRules")
|
|
4
|
-
const typescriptRules = require("./typescriptRules")
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line import/no-dynamic-require
|
|
7
|
-
const packageJson = require(path.resolve("package.json"))
|
|
8
|
-
|
|
9
|
-
const usesTypeScript = Object.keys({
|
|
10
|
-
...packageJson.dependencies,
|
|
11
|
-
...packageJson.devDependencies,
|
|
12
|
-
}).includes("typescript")
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
env: {
|
|
16
|
-
browser: true,
|
|
17
|
-
es6: true,
|
|
18
|
-
},
|
|
19
|
-
extends: ["airbnb", "airbnb/hooks", "prettier"],
|
|
20
|
-
globals: { chayns: true },
|
|
21
|
-
rules: { ...sharedRules, ...javascriptRules },
|
|
22
|
-
parser: "@babel/eslint-parser",
|
|
23
|
-
parserOptions: {
|
|
24
|
-
requireConfigFile: false,
|
|
25
|
-
},
|
|
26
|
-
settings: {
|
|
27
|
-
"import/resolver": {
|
|
28
|
-
typescript: { project: "@(jsconfig|tsconfig).json" },
|
|
29
|
-
},
|
|
30
|
-
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
|
|
31
|
-
},
|
|
32
|
-
overrides: [
|
|
33
|
-
usesTypeScript && {
|
|
34
|
-
files: ["**/*.ts?(x)"],
|
|
35
|
-
extends: [
|
|
36
|
-
"airbnb-typescript",
|
|
37
|
-
"airbnb/hooks",
|
|
38
|
-
"plugin:@typescript-eslint/recommended",
|
|
39
|
-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
40
|
-
"prettier",
|
|
41
|
-
"plugin:import/typescript",
|
|
42
|
-
],
|
|
43
|
-
rules: {
|
|
44
|
-
...sharedRules,
|
|
45
|
-
...typescriptRules,
|
|
46
|
-
},
|
|
47
|
-
parserOptions: {
|
|
48
|
-
project: "./tsconfig.json",
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
files: ["**/*.@(test|spec).@(js|jsx|ts|tsx)"],
|
|
53
|
-
env: { "jest/globals": true },
|
|
54
|
-
plugins: ["jest"],
|
|
55
|
-
rules: {
|
|
56
|
-
...sharedRules,
|
|
57
|
-
"jest/no-disabled-tests": "warn",
|
|
58
|
-
"jest/no-focused-tests": "error",
|
|
59
|
-
"jest/no-identical-title": "error",
|
|
60
|
-
"jest/prefer-to-have-length": "warn",
|
|
61
|
-
"jest/valid-expect": "error",
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
].filter(Boolean),
|
|
65
|
-
}
|
|
1
|
+
const path = require("path")
|
|
2
|
+
const javascriptRules = require("./javascriptRules")
|
|
3
|
+
const sharedRules = require("./sharedRules")
|
|
4
|
+
const typescriptRules = require("./typescriptRules")
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line import/no-dynamic-require
|
|
7
|
+
const packageJson = require(path.resolve("package.json"))
|
|
8
|
+
|
|
9
|
+
const usesTypeScript = Object.keys({
|
|
10
|
+
...packageJson.dependencies,
|
|
11
|
+
...packageJson.devDependencies,
|
|
12
|
+
}).includes("typescript")
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
env: {
|
|
16
|
+
browser: true,
|
|
17
|
+
es6: true,
|
|
18
|
+
},
|
|
19
|
+
extends: ["airbnb", "airbnb/hooks", "prettier"],
|
|
20
|
+
globals: { chayns: true },
|
|
21
|
+
rules: { ...sharedRules, ...javascriptRules },
|
|
22
|
+
parser: "@babel/eslint-parser",
|
|
23
|
+
parserOptions: {
|
|
24
|
+
requireConfigFile: false,
|
|
25
|
+
},
|
|
26
|
+
settings: {
|
|
27
|
+
"import/resolver": {
|
|
28
|
+
typescript: { project: "@(jsconfig|tsconfig).json" },
|
|
29
|
+
},
|
|
30
|
+
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
|
|
31
|
+
},
|
|
32
|
+
overrides: [
|
|
33
|
+
usesTypeScript && {
|
|
34
|
+
files: ["**/*.ts?(x)"],
|
|
35
|
+
extends: [
|
|
36
|
+
"airbnb-typescript",
|
|
37
|
+
"airbnb/hooks",
|
|
38
|
+
"plugin:@typescript-eslint/recommended",
|
|
39
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
40
|
+
"prettier",
|
|
41
|
+
"plugin:import/typescript",
|
|
42
|
+
],
|
|
43
|
+
rules: {
|
|
44
|
+
...sharedRules,
|
|
45
|
+
...typescriptRules,
|
|
46
|
+
},
|
|
47
|
+
parserOptions: {
|
|
48
|
+
project: "./tsconfig.json",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
files: ["**/*.@(test|spec).@(js|jsx|ts|tsx)"],
|
|
53
|
+
env: { "jest/globals": true },
|
|
54
|
+
plugins: ["jest"],
|
|
55
|
+
rules: {
|
|
56
|
+
...sharedRules,
|
|
57
|
+
"jest/no-disabled-tests": "warn",
|
|
58
|
+
"jest/no-focused-tests": "error",
|
|
59
|
+
"jest/no-identical-title": "error",
|
|
60
|
+
"jest/prefer-to-have-length": "warn",
|
|
61
|
+
"jest/valid-expect": "error",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
].filter(Boolean),
|
|
65
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const javascriptRules = {
|
|
2
|
-
"no-use-before-define": [
|
|
3
|
-
"error",
|
|
4
|
-
{ functions: false, classes: false, variables: false },
|
|
5
|
-
],
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
module.exports = javascriptRules
|
|
1
|
+
const javascriptRules = {
|
|
2
|
+
"no-use-before-define": [
|
|
3
|
+
"error",
|
|
4
|
+
{ functions: false, classes: false, variables: false },
|
|
5
|
+
],
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
module.exports = javascriptRules
|
package/eslint/sharedRules.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
const sharedRules = {
|
|
2
|
-
"import/extensions": [
|
|
3
|
-
"error",
|
|
4
|
-
"always",
|
|
5
|
-
{ js: "never", jsx: "never", ts: "never", tsx: "never" },
|
|
6
|
-
],
|
|
7
|
-
"import/no-unresolved": ["error", { ignore: ["chayns-components"] }],
|
|
8
|
-
"import/prefer-default-export": "off",
|
|
9
|
-
"jsx-a11y/anchor-has-content": "off",
|
|
10
|
-
"jsx-a11y/anchor-is-valid": "off",
|
|
11
|
-
"jsx-a11y/click-events-have-key-events": "off",
|
|
12
|
-
"jsx-a11y/heading-has-content": "off",
|
|
13
|
-
"jsx-a11y/href-no-hash": "off",
|
|
14
|
-
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
|
15
|
-
"jsx-a11y/no-static-element-interactions": "off",
|
|
16
|
-
"no-console": ["warn", { allow: ["warn", "error"] }],
|
|
17
|
-
"no-param-reassign": [
|
|
18
|
-
"error",
|
|
19
|
-
{ ignorePropertyModificationsFor: ["draft"], props: true },
|
|
20
|
-
],
|
|
21
|
-
"no-plusplus": "off",
|
|
22
|
-
"no-restricted-imports": [
|
|
23
|
-
"error",
|
|
24
|
-
{
|
|
25
|
-
message: "Use 'chayns-components' instead to enable tree-shaking.",
|
|
26
|
-
name: "chayns-components/lib",
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
"react/no-danger": "off",
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = sharedRules
|
|
1
|
+
const sharedRules = {
|
|
2
|
+
"import/extensions": [
|
|
3
|
+
"error",
|
|
4
|
+
"always",
|
|
5
|
+
{ js: "never", jsx: "never", ts: "never", tsx: "never" },
|
|
6
|
+
],
|
|
7
|
+
"import/no-unresolved": ["error", { ignore: ["chayns-components"] }],
|
|
8
|
+
"import/prefer-default-export": "off",
|
|
9
|
+
"jsx-a11y/anchor-has-content": "off",
|
|
10
|
+
"jsx-a11y/anchor-is-valid": "off",
|
|
11
|
+
"jsx-a11y/click-events-have-key-events": "off",
|
|
12
|
+
"jsx-a11y/heading-has-content": "off",
|
|
13
|
+
"jsx-a11y/href-no-hash": "off",
|
|
14
|
+
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
|
15
|
+
"jsx-a11y/no-static-element-interactions": "off",
|
|
16
|
+
"no-console": ["warn", { allow: ["warn", "error"] }],
|
|
17
|
+
"no-param-reassign": [
|
|
18
|
+
"error",
|
|
19
|
+
{ ignorePropertyModificationsFor: ["draft"], props: true },
|
|
20
|
+
],
|
|
21
|
+
"no-plusplus": "off",
|
|
22
|
+
"no-restricted-imports": [
|
|
23
|
+
"error",
|
|
24
|
+
{
|
|
25
|
+
message: "Use 'chayns-components' instead to enable tree-shaking.",
|
|
26
|
+
name: "chayns-components/lib",
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
"react/no-danger": "off",
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = sharedRules
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const typescriptRules = {
|
|
2
|
-
"react/prop-types": "off",
|
|
3
|
-
"react/require-default-props": "off",
|
|
4
|
-
"@typescript-eslint/no-use-before-define": [
|
|
5
|
-
"error",
|
|
6
|
-
{ functions: false, classes: false, variables: false, enums: false },
|
|
7
|
-
],
|
|
8
|
-
"@typescript-eslint/ban-ts-comment": [
|
|
9
|
-
"error",
|
|
10
|
-
{
|
|
11
|
-
"ts-expect-error": "allow-with-description",
|
|
12
|
-
"ts-ignore": true,
|
|
13
|
-
"ts-nocheck": true,
|
|
14
|
-
"ts-check": true,
|
|
15
|
-
minimumDescriptionLength: 4,
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
module.exports = typescriptRules
|
|
1
|
+
const typescriptRules = {
|
|
2
|
+
"react/prop-types": "off",
|
|
3
|
+
"react/require-default-props": "off",
|
|
4
|
+
"@typescript-eslint/no-use-before-define": [
|
|
5
|
+
"error",
|
|
6
|
+
{ functions: false, classes: false, variables: false, enums: false },
|
|
7
|
+
],
|
|
8
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
9
|
+
"error",
|
|
10
|
+
{
|
|
11
|
+
"ts-expect-error": "allow-with-description",
|
|
12
|
+
"ts-ignore": true,
|
|
13
|
+
"ts-nocheck": true,
|
|
14
|
+
"ts-check": true,
|
|
15
|
+
minimumDescriptionLength: 4,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = typescriptRules
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
-
require("@testing-library/jest-dom")
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
require("@testing-library/jest-dom")
|