@paratco/eslint-config 0.4.5 → 0.6.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/.prettierrc.json +22 -22
- package/index.js +5 -1
- package/package.json +37 -37
- package/prettier/README.md +22 -22
- package/prettier/index.json +22 -22
- package/prettier/package.json +20 -20
- package/src/configs/base.js +1 -6
- package/src/configs/node.js +9 -9
- package/src/configs/prettierFormatter.js +4 -0
- package/src/configs/react.js +58 -61
- package/src/configs/stylisticFormatter.js +33 -0
- package/src/lints/stylistic/index.js +508 -0
- package/src/lints/typescript/index.js +249 -249
- package/eslint.config.mjs +0 -81
package/.prettierrc.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/prettierrc",
|
|
3
|
-
"printWidth": 120,
|
|
4
|
-
"tabWidth": 2,
|
|
5
|
-
"useTabs": false,
|
|
6
|
-
"semi": true,
|
|
7
|
-
"singleQuote": false,
|
|
8
|
-
"quoteProps": "as-needed",
|
|
9
|
-
"jsxSingleQuote": false,
|
|
10
|
-
"trailingComma": "none",
|
|
11
|
-
"bracketSpacing": true,
|
|
12
|
-
"bracketSameLine": false,
|
|
13
|
-
"arrowParens": "always",
|
|
14
|
-
"requirePragma": false,
|
|
15
|
-
"insertPragma": false,
|
|
16
|
-
"proseWrap": "preserve",
|
|
17
|
-
"htmlWhitespaceSensitivity": "css",
|
|
18
|
-
"vueIndentScriptAndStyle": false,
|
|
19
|
-
"endOfLine": "lf",
|
|
20
|
-
"embeddedLanguageFormatting": "auto",
|
|
21
|
-
"singleAttributePerLine": false
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/prettierrc",
|
|
3
|
+
"printWidth": 120,
|
|
4
|
+
"tabWidth": 2,
|
|
5
|
+
"useTabs": false,
|
|
6
|
+
"semi": true,
|
|
7
|
+
"singleQuote": false,
|
|
8
|
+
"quoteProps": "as-needed",
|
|
9
|
+
"jsxSingleQuote": false,
|
|
10
|
+
"trailingComma": "none",
|
|
11
|
+
"bracketSpacing": true,
|
|
12
|
+
"bracketSameLine": false,
|
|
13
|
+
"arrowParens": "always",
|
|
14
|
+
"requirePragma": false,
|
|
15
|
+
"insertPragma": false,
|
|
16
|
+
"proseWrap": "preserve",
|
|
17
|
+
"htmlWhitespaceSensitivity": "css",
|
|
18
|
+
"vueIndentScriptAndStyle": false,
|
|
19
|
+
"endOfLine": "lf",
|
|
20
|
+
"embeddedLanguageFormatting": "auto",
|
|
21
|
+
"singleAttributePerLine": false
|
|
22
|
+
}
|
package/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import baseConfig from "./src/configs/base.js";
|
|
2
2
|
import reactConfig from "./src/configs/react.js";
|
|
3
3
|
import nodeConfig from "./src/configs/node.js";
|
|
4
|
+
import prettierFormatter from "./src/configs/prettierFormatter.js";
|
|
5
|
+
import stylisticFormatter from "./src/configs/stylisticFormatter.js";
|
|
4
6
|
|
|
5
7
|
export default {
|
|
6
8
|
base: baseConfig,
|
|
7
9
|
react: reactConfig,
|
|
8
|
-
node: nodeConfig
|
|
10
|
+
node: nodeConfig,
|
|
11
|
+
prettierFormatter,
|
|
12
|
+
stylisticFormatter
|
|
9
13
|
};
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@paratco/eslint-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"author": "Paratco",
|
|
7
|
-
"license": "ISC",
|
|
8
|
-
"description": "Paratco ESLint Config",
|
|
9
|
-
"repository": "git@github.com/Paratco/javascript.git",
|
|
10
|
-
"keywords": [
|
|
11
|
-
"eslint",
|
|
12
|
-
"eslint-config",
|
|
13
|
-
"react",
|
|
14
|
-
"node",
|
|
15
|
-
"node.js",
|
|
16
|
-
"lint"
|
|
17
|
-
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"lint": "eslint . --report-unused-disable-directives-severity error --max-warnings 0",
|
|
20
|
-
"format": "prettier --write src/"
|
|
21
|
-
},
|
|
22
|
-
"peerDependencies": {
|
|
23
|
-
"eslint": "^
|
|
24
|
-
"prettier": "^3.3.2",
|
|
25
|
-
"typescript-eslint": "^7.
|
|
26
|
-
},
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"@eslint/
|
|
29
|
-
"@eslint
|
|
30
|
-
"@types/eslint__js": "^8.42.3",
|
|
31
|
-
"eslint-config-prettier": "^9.1.0",
|
|
32
|
-
"eslint-plugin-react": "^7.34.
|
|
33
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
34
|
-
"eslint-plugin-react-refresh": "^0.4.7",
|
|
35
|
-
"globals": "^15.
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@paratco/eslint-config",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"author": "Paratco",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"description": "Paratco ESLint Config",
|
|
9
|
+
"repository": "git@github.com/Paratco/javascript.git",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"eslint",
|
|
12
|
+
"eslint-config",
|
|
13
|
+
"react",
|
|
14
|
+
"node",
|
|
15
|
+
"node.js",
|
|
16
|
+
"lint"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"lint": "eslint . --report-unused-disable-directives-severity error --max-warnings 0",
|
|
20
|
+
"format": "prettier --write src/"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"eslint": "^8.57.0",
|
|
24
|
+
"prettier": "^3.3.2",
|
|
25
|
+
"typescript-eslint": "^7.16.0"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@eslint/js": "^9.6.0",
|
|
29
|
+
"@stylistic/eslint-plugin": "^2.3.0",
|
|
30
|
+
"@types/eslint__js": "^8.42.3",
|
|
31
|
+
"eslint-config-prettier": "^9.1.0",
|
|
32
|
+
"eslint-plugin-react": "^7.34.3",
|
|
33
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
34
|
+
"eslint-plugin-react-refresh": "^0.4.7",
|
|
35
|
+
"globals": "^15.8.0"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/prettier/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# `@paratco/prettier-config`
|
|
2
|
-
|
|
3
|
-
Paratco Prettier configs
|
|
4
|
-
|
|
5
|
-
### Installation
|
|
6
|
-
|
|
7
|
-
NPM:
|
|
8
|
-
```bash
|
|
9
|
-
npm install --save-dev @paratco/prettier-config prettier
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Yarn:
|
|
13
|
-
```bash
|
|
14
|
-
yarn add -D @paratco/prettier-config prettier
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### Usage:
|
|
18
|
-
|
|
19
|
-
In your `.prettierrc.json` file:
|
|
20
|
-
```json
|
|
21
|
-
"@paratco/prettier-config"
|
|
22
|
-
```
|
|
1
|
+
# `@paratco/prettier-config`
|
|
2
|
+
|
|
3
|
+
Paratco Prettier configs
|
|
4
|
+
|
|
5
|
+
### Installation
|
|
6
|
+
|
|
7
|
+
NPM:
|
|
8
|
+
```bash
|
|
9
|
+
npm install --save-dev @paratco/prettier-config prettier
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Yarn:
|
|
13
|
+
```bash
|
|
14
|
+
yarn add -D @paratco/prettier-config prettier
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Usage:
|
|
18
|
+
|
|
19
|
+
In your `.prettierrc.json` file:
|
|
20
|
+
```json
|
|
21
|
+
"@paratco/prettier-config"
|
|
22
|
+
```
|
package/prettier/index.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/prettierrc",
|
|
3
|
-
"printWidth": 120,
|
|
4
|
-
"tabWidth": 2,
|
|
5
|
-
"useTabs": false,
|
|
6
|
-
"semi": true,
|
|
7
|
-
"singleQuote": false,
|
|
8
|
-
"quoteProps": "as-needed",
|
|
9
|
-
"jsxSingleQuote": false,
|
|
10
|
-
"trailingComma": "none",
|
|
11
|
-
"bracketSpacing": true,
|
|
12
|
-
"bracketSameLine": false,
|
|
13
|
-
"arrowParens": "always",
|
|
14
|
-
"requirePragma": false,
|
|
15
|
-
"insertPragma": false,
|
|
16
|
-
"proseWrap": "preserve",
|
|
17
|
-
"htmlWhitespaceSensitivity": "css",
|
|
18
|
-
"vueIndentScriptAndStyle": false,
|
|
19
|
-
"endOfLine": "lf",
|
|
20
|
-
"embeddedLanguageFormatting": "auto",
|
|
21
|
-
"singleAttributePerLine": false
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/prettierrc",
|
|
3
|
+
"printWidth": 120,
|
|
4
|
+
"tabWidth": 2,
|
|
5
|
+
"useTabs": false,
|
|
6
|
+
"semi": true,
|
|
7
|
+
"singleQuote": false,
|
|
8
|
+
"quoteProps": "as-needed",
|
|
9
|
+
"jsxSingleQuote": false,
|
|
10
|
+
"trailingComma": "none",
|
|
11
|
+
"bracketSpacing": true,
|
|
12
|
+
"bracketSameLine": false,
|
|
13
|
+
"arrowParens": "always",
|
|
14
|
+
"requirePragma": false,
|
|
15
|
+
"insertPragma": false,
|
|
16
|
+
"proseWrap": "preserve",
|
|
17
|
+
"htmlWhitespaceSensitivity": "css",
|
|
18
|
+
"vueIndentScriptAndStyle": false,
|
|
19
|
+
"endOfLine": "lf",
|
|
20
|
+
"embeddedLanguageFormatting": "auto",
|
|
21
|
+
"singleAttributePerLine": false
|
|
22
|
+
}
|
package/prettier/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@paratco/prettier-config",
|
|
3
|
-
"version": "0.1.1",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "index.json",
|
|
6
|
-
"author": "Paratco",
|
|
7
|
-
"license": "ISC",
|
|
8
|
-
"description": "Paratco Prettier Config",
|
|
9
|
-
"repository": "git@github.com/Paratco/javascript.git",
|
|
10
|
-
"keywords": [
|
|
11
|
-
"prettier",
|
|
12
|
-
"prettier-config"
|
|
13
|
-
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
16
|
-
},
|
|
17
|
-
"peerDependencies": {
|
|
18
|
-
"prettier": "^3.3.2"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@paratco/prettier-config",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "index.json",
|
|
6
|
+
"author": "Paratco",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"description": "Paratco Prettier Config",
|
|
9
|
+
"repository": "git@github.com/Paratco/javascript.git",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"prettier",
|
|
12
|
+
"prettier-config"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"prettier": "^3.3.2"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/src/configs/base.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import eslint from "@eslint/js";
|
|
2
2
|
import tseslint from "typescript-eslint";
|
|
3
3
|
|
|
4
|
-
// Plugins
|
|
5
|
-
import eslintConfigPrettier from "eslint-config-prettier";
|
|
6
|
-
|
|
7
4
|
// Custom Rules
|
|
8
5
|
import typescriptRules from "../lints/typescript/index.js";
|
|
9
6
|
|
|
@@ -17,7 +14,5 @@ export default [
|
|
|
17
14
|
{
|
|
18
15
|
files: ["**/*.{ts,tsx}"],
|
|
19
16
|
rules: typescriptRules
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
eslintConfigPrettier
|
|
17
|
+
}
|
|
23
18
|
];
|
package/src/configs/node.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import globals from "globals";
|
|
2
|
-
import baseConfig from "./base.js";
|
|
3
|
-
|
|
4
|
-
export default [
|
|
5
|
-
...baseConfig,
|
|
6
|
-
|
|
7
|
-
// Node Only
|
|
8
|
-
{ languageOptions: { globals: globals.node } }
|
|
9
|
-
];
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
import baseConfig from "./base.js";
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
...baseConfig,
|
|
6
|
+
|
|
7
|
+
// Node Only
|
|
8
|
+
{ languageOptions: { globals: globals.node } }
|
|
9
|
+
];
|
package/src/configs/react.js
CHANGED
|
@@ -1,61 +1,58 @@
|
|
|
1
|
-
import globals from "globals";
|
|
2
|
-
import baseConfig from "./base.js";
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
{ languageOptions: {
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
"react-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
];
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
import baseConfig from "./base.js";
|
|
3
|
+
|
|
4
|
+
// Plugins
|
|
5
|
+
import react from "eslint-plugin-react";
|
|
6
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
7
|
+
import reactRefresh from "eslint-plugin-react-refresh";
|
|
8
|
+
|
|
9
|
+
// Custom Rules
|
|
10
|
+
import reactRules from "../lints/react/index.js";
|
|
11
|
+
|
|
12
|
+
export default [
|
|
13
|
+
...baseConfig,
|
|
14
|
+
|
|
15
|
+
// Browser Only
|
|
16
|
+
{ languageOptions: { globals: globals.browser } },
|
|
17
|
+
|
|
18
|
+
// Enable JSX
|
|
19
|
+
{ files: ["**/*.tsx"], languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } },
|
|
20
|
+
|
|
21
|
+
// React Plugin
|
|
22
|
+
{
|
|
23
|
+
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
24
|
+
plugins: {
|
|
25
|
+
react: react,
|
|
26
|
+
"react-hooks": reactHooks,
|
|
27
|
+
"react-refresh": reactRefresh
|
|
28
|
+
},
|
|
29
|
+
settings: {
|
|
30
|
+
react: {
|
|
31
|
+
version: "detect"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
languageOptions: {
|
|
35
|
+
parserOptions: {
|
|
36
|
+
ecmaFeatures: {
|
|
37
|
+
jsx: true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
globals: {
|
|
41
|
+
...globals.browser
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
rules: {
|
|
45
|
+
...reactRules,
|
|
46
|
+
// ...react.configs.recommended.rules,
|
|
47
|
+
...reactHooks.configs.recommended.rules,
|
|
48
|
+
|
|
49
|
+
// Enforce Rules of Hooks
|
|
50
|
+
"react-hooks/rules-of-hooks": ["error"],
|
|
51
|
+
// Verify the list of the dependencies for Hooks like useEffect and similar
|
|
52
|
+
"react-hooks/exhaustive-deps": ["error"],
|
|
53
|
+
|
|
54
|
+
// React Refresh
|
|
55
|
+
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import stylistic from "@stylistic/eslint-plugin";
|
|
2
|
+
|
|
3
|
+
// Custom Rules
|
|
4
|
+
import stylisticRules from "../lints/stylistic/index.js";
|
|
5
|
+
|
|
6
|
+
export default [
|
|
7
|
+
// Stylistic Configs
|
|
8
|
+
stylistic.configs.customize({
|
|
9
|
+
jsx: true,
|
|
10
|
+
arrowParens: true,
|
|
11
|
+
flat: true,
|
|
12
|
+
blockSpacing: true,
|
|
13
|
+
braceStyle: "stroustrup",
|
|
14
|
+
commaDangle: "always-multiline",
|
|
15
|
+
indent: 2,
|
|
16
|
+
semi: true,
|
|
17
|
+
quotes: "double",
|
|
18
|
+
quoteProps: "always"
|
|
19
|
+
}),
|
|
20
|
+
|
|
21
|
+
// Stylistic Rules
|
|
22
|
+
{
|
|
23
|
+
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
24
|
+
languageOptions: {
|
|
25
|
+
parserOptions: {
|
|
26
|
+
ecmaFeatures: {
|
|
27
|
+
jsx: true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
rules: stylisticRules
|
|
32
|
+
}
|
|
33
|
+
];
|