@evaneos/front-config 0.0.1 → 0.0.3
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/README.md +6 -9
- package/linting/eslint.config.js +33 -0
- package/linting/prettier.js +5 -0
- package/linting/rules/override.js +22 -9
- package/linting/rules/react.js +13 -15
- package/linting/rules/test.js +5 -7
- package/package.json +9 -1
- package/linting/eslint-config-base.js +0 -15
- package/linting/eslint-config.js +0 -19
- package/linting/prettier-config.js +0 -4
- package/linting/rules/prettier.js +0 -3
- package/linting/rules/style.js +0 -16
package/README.md
CHANGED
|
@@ -10,17 +10,15 @@ npm install @evaneos/front-config@latest
|
|
|
10
10
|
|
|
11
11
|
# Usage
|
|
12
12
|
|
|
13
|
-
## Eslint
|
|
13
|
+
## Eslint flat config
|
|
14
14
|
|
|
15
|
-
In your
|
|
15
|
+
In your `eslint.config.js` file, add:
|
|
16
16
|
|
|
17
17
|
```json
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
}
|
|
18
|
+
const evaneosConfig = require("@evaneos/front-config/linting/eslint.config.js")
|
|
19
|
+
module.export = [
|
|
20
|
+
...evaneosConfig
|
|
21
|
+
]
|
|
24
22
|
```
|
|
25
23
|
|
|
26
24
|
## TSConfig
|
|
@@ -40,6 +38,5 @@ In your `.prettierrc` file add:
|
|
|
40
38
|
```js
|
|
41
39
|
module.exports = {
|
|
42
40
|
...require("@evaneos/front-config/linting/prettier-config.js"),
|
|
43
|
-
semi: false,
|
|
44
41
|
};
|
|
45
42
|
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
const eslintConfigPrettier = require("eslint-config-prettier");
|
|
4
|
+
|
|
5
|
+
const eslint = require("@eslint/js");
|
|
6
|
+
const tseslint = require("typescript-eslint");
|
|
7
|
+
|
|
8
|
+
const reactLint = require("./rules/react");
|
|
9
|
+
const testLint = require("./rules/test");
|
|
10
|
+
const evaneosOverrides = require("./rules/override");
|
|
11
|
+
|
|
12
|
+
module.exports = tseslint.config(
|
|
13
|
+
eslint.configs.recommended,
|
|
14
|
+
tseslint.configs.recommendedTypeChecked,
|
|
15
|
+
{
|
|
16
|
+
languageOptions: {
|
|
17
|
+
parserOptions: {
|
|
18
|
+
projectService: true,
|
|
19
|
+
tsconfigRootDir: __dirname,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
files: ["**/*.js"],
|
|
25
|
+
extends: [tseslint.configs.disableTypeChecked],
|
|
26
|
+
},
|
|
27
|
+
eslintConfigPrettier,
|
|
28
|
+
testLint,
|
|
29
|
+
// @ts-expect-error
|
|
30
|
+
...reactLint,
|
|
31
|
+
// custom evaneos rules
|
|
32
|
+
...evaneosOverrides
|
|
33
|
+
);
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
module.exports =
|
|
2
|
-
|
|
1
|
+
module.exports = [
|
|
2
|
+
{
|
|
3
3
|
rules: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
"import/no-default-export": 2,
|
|
5
|
+
"import/newline-after-import": 1,
|
|
6
|
+
"import/no-duplicates": 2,
|
|
7
|
+
"import/order": [
|
|
8
|
+
"warn",
|
|
9
|
+
{
|
|
10
|
+
alphabetize: {
|
|
11
|
+
order: "asc",
|
|
12
|
+
caseInsensitive: true,
|
|
13
|
+
},
|
|
14
|
+
"newlines-between": "always",
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
"no-process-env": 0,
|
|
18
|
+
"prefer-const": 1,
|
|
19
|
+
"prefer-destructuring": 1,
|
|
20
|
+
"prefer-spread": 1,
|
|
21
|
+
"arrow-body-style": 0,
|
|
10
22
|
},
|
|
11
|
-
}
|
|
23
|
+
},
|
|
24
|
+
];
|
package/linting/rules/react.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
'import/extensions': ['.js', '.jsx', '.css'],
|
|
9
|
-
},
|
|
1
|
+
const reactPlugin = require("eslint-plugin-react");
|
|
2
|
+
|
|
3
|
+
module.exports = [
|
|
4
|
+
reactPlugin.configs.flat.recommended,
|
|
5
|
+
reactPlugin.configs.flat["jsx-runtime"],
|
|
6
|
+
{
|
|
10
7
|
rules: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
"react-hooks/exhaustive-deps": 1,
|
|
9
|
+
"react-hooks/rules-of-hooks": 2,
|
|
10
|
+
"react/display-name": 0,
|
|
11
|
+
"react/prop-types": 0,
|
|
12
|
+
"react/react-in-jsx-scope": 0,
|
|
16
13
|
},
|
|
17
|
-
}
|
|
14
|
+
},
|
|
15
|
+
];
|
package/linting/rules/test.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
const testingLibrary = require("eslint-plugin-testing-library");
|
|
2
|
+
|
|
1
3
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
extends: ['plugin:testing-library/react'],
|
|
6
|
-
}
|
|
7
|
-
]
|
|
8
|
-
}
|
|
4
|
+
files: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
|
|
5
|
+
...testingLibrary.configs["flat/react"],
|
|
6
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evaneos/front-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=v18",
|
|
6
6
|
"npm": ">=9"
|
|
@@ -18,5 +18,13 @@
|
|
|
18
18
|
"@commitlint/config-conventional": "^19.2.2",
|
|
19
19
|
"commitlint-plugin-function-rules": "^4.0.0",
|
|
20
20
|
"husky": "^9.1.4"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@eslint/js": "^9.17.0",
|
|
24
|
+
"eslint-config-prettier": "^9.1.0",
|
|
25
|
+
"eslint-plugin-react": "^7.37.3",
|
|
26
|
+
"eslint-plugin-testing-library": "^6.5.0",
|
|
27
|
+
"typescript": "^5.7.2",
|
|
28
|
+
"typescript-eslint": "^8.19.0"
|
|
21
29
|
}
|
|
22
30
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@babel/eslint-parser',
|
|
3
|
-
env: {
|
|
4
|
-
browser: true,
|
|
5
|
-
es6: true,
|
|
6
|
-
},
|
|
7
|
-
extends: [
|
|
8
|
-
'eslint:recommended',
|
|
9
|
-
require.resolve('./rules/override'),
|
|
10
|
-
require.resolve('./rules/react'),
|
|
11
|
-
require.resolve('./rules/style'),
|
|
12
|
-
require.resolve('./rules/test'),
|
|
13
|
-
require.resolve('./rules/prettier'),
|
|
14
|
-
],
|
|
15
|
-
};
|
package/linting/eslint-config.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
plugins: ['@typescript-eslint'],
|
|
4
|
-
extends: [
|
|
5
|
-
'@evaneos/eslint-config-base',
|
|
6
|
-
'plugin:@typescript-eslint/recommended',
|
|
7
|
-
'plugin:import/typescript',
|
|
8
|
-
'@evaneos/eslint-config-base/prettier',
|
|
9
|
-
],
|
|
10
|
-
settings: {
|
|
11
|
-
'import/extensions': [ '.js', '.jsx', '.css', '.ts', '.tsx' ],
|
|
12
|
-
},
|
|
13
|
-
rules: {
|
|
14
|
-
'@typescript-eslint/ban-ts-comment': 0,
|
|
15
|
-
'@typescript-eslint/camelcase': 0,
|
|
16
|
-
'@typescript-eslint/no-floating-promises': 'error',
|
|
17
|
-
'@typescript-eslint/no-unused-vars': [ 'error', { 'ignoreRestSiblings': true } ],
|
|
18
|
-
},
|
|
19
|
-
};
|
package/linting/rules/style.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
rules: {
|
|
3
|
-
'import/newline-after-import': 1,
|
|
4
|
-
'import/no-duplicates': 2,
|
|
5
|
-
'import/order': [
|
|
6
|
-
'warn',
|
|
7
|
-
{
|
|
8
|
-
alphabetize: {
|
|
9
|
-
order: 'asc',
|
|
10
|
-
caseInsensitive: true,
|
|
11
|
-
},
|
|
12
|
-
'newlines-between': 'always',
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
};
|