@paratco/eslint-config 0.8.7 → 1.0.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/.github/dependabot.yml +14 -0
- package/.github/workflows/publish.yml +51 -0
- package/.prettierrc.json +22 -22
- package/.yarnrc.yml +1 -0
- package/README.md +47 -47
- package/package.json +18 -14
- package/prettier/README.md +22 -22
- package/prettier/index.json +22 -22
- package/prettier/package.json +20 -20
- package/src/configs/node.js +9 -9
- package/src/configs/prettierFormatter.js +4 -4
- package/src/configs/react.js +58 -58
- package/src/configs/stylisticFormatter.js +33 -33
- package/src/lints/typescript/index.js +2 -2
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Publish To NPM
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on:
|
|
10
|
+
- ubuntu-latest
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
id-token: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Check out the repo
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Check build version
|
|
21
|
+
uses: actions/github-script@v7
|
|
22
|
+
with:
|
|
23
|
+
script: |
|
|
24
|
+
try {
|
|
25
|
+
const fs = require("fs")
|
|
26
|
+
const jsonString = fs.readFileSync("package.json")
|
|
27
|
+
const package = JSON.parse(jsonString)
|
|
28
|
+
if (package.version !== "${{ github.ref_name }}") {
|
|
29
|
+
core.setFailed(`package.json version (${package.version}) not match version of release (${{ github.ref_name }})`)
|
|
30
|
+
}
|
|
31
|
+
} catch(err) {
|
|
32
|
+
core.setFailed(err)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- name: Setup Node
|
|
36
|
+
uses: actions/setup-node@v4
|
|
37
|
+
with:
|
|
38
|
+
node-version: 20
|
|
39
|
+
check-latest: 'true'
|
|
40
|
+
registry-url: "https://registry.npmjs.org"
|
|
41
|
+
|
|
42
|
+
- name: Enable Yarn
|
|
43
|
+
run: corepack enable
|
|
44
|
+
|
|
45
|
+
- name: Install dependencies
|
|
46
|
+
run: yarn install
|
|
47
|
+
|
|
48
|
+
- name: Publish package on NPM
|
|
49
|
+
run: npm publish --provenance --access public
|
|
50
|
+
env:
|
|
51
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}
|
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/.yarnrc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodeLinker: node-modules
|
package/README.md
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
# `@paratco/eslint-config`
|
|
2
|
-
|
|
3
|
-
Paratco ESLint configs
|
|
4
|
-
|
|
5
|
-
- Typescript
|
|
6
|
-
- React (optional)
|
|
7
|
-
|
|
8
|
-
### Installation
|
|
9
|
-
|
|
10
|
-
NPM:
|
|
11
|
-
```bash
|
|
12
|
-
npm install --save-dev @paratco/eslint-config eslint prettier typescript-eslint
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Yarn:
|
|
16
|
-
```bash
|
|
17
|
-
yarn add -D @paratco/eslint-config eslint prettier typescript-eslint
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### Usage (Flat config):
|
|
21
|
-
|
|
22
|
-
Node.JS:
|
|
23
|
-
```javascript
|
|
24
|
-
import paratcoEslintConfig from "@paratco/eslint-config";
|
|
25
|
-
|
|
26
|
-
export default [
|
|
27
|
-
...paratcoEslintConfig.node,
|
|
28
|
-
];
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
React:
|
|
32
|
-
```javascript
|
|
33
|
-
import paratcoEslintConfig from "@paratco/eslint-config";
|
|
34
|
-
|
|
35
|
-
export default [
|
|
36
|
-
...paratcoEslintConfig.react,
|
|
37
|
-
];
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Base (JS + TS rules):
|
|
41
|
-
```javascript
|
|
42
|
-
import paratcoEslintConfig from "@paratco/eslint-config";
|
|
43
|
-
|
|
44
|
-
export default [
|
|
45
|
-
...paratcoEslintConfig.base,
|
|
46
|
-
];
|
|
47
|
-
```
|
|
1
|
+
# `@paratco/eslint-config`
|
|
2
|
+
|
|
3
|
+
Paratco ESLint configs
|
|
4
|
+
|
|
5
|
+
- Typescript
|
|
6
|
+
- React (optional)
|
|
7
|
+
|
|
8
|
+
### Installation
|
|
9
|
+
|
|
10
|
+
NPM:
|
|
11
|
+
```bash
|
|
12
|
+
npm install --save-dev @paratco/eslint-config eslint prettier typescript-eslint
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Yarn:
|
|
16
|
+
```bash
|
|
17
|
+
yarn add -D @paratco/eslint-config eslint prettier typescript-eslint
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Usage (Flat config):
|
|
21
|
+
|
|
22
|
+
Node.JS:
|
|
23
|
+
```javascript
|
|
24
|
+
import paratcoEslintConfig from "@paratco/eslint-config";
|
|
25
|
+
|
|
26
|
+
export default [
|
|
27
|
+
...paratcoEslintConfig.node,
|
|
28
|
+
];
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
React:
|
|
32
|
+
```javascript
|
|
33
|
+
import paratcoEslintConfig from "@paratco/eslint-config";
|
|
34
|
+
|
|
35
|
+
export default [
|
|
36
|
+
...paratcoEslintConfig.react,
|
|
37
|
+
];
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Base (JS + TS rules):
|
|
41
|
+
```javascript
|
|
42
|
+
import paratcoEslintConfig from "@paratco/eslint-config";
|
|
43
|
+
|
|
44
|
+
export default [
|
|
45
|
+
...paratcoEslintConfig.base,
|
|
46
|
+
];
|
|
47
|
+
```
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paratco/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Paratco",
|
|
7
7
|
"license": "ISC",
|
|
8
8
|
"description": "Paratco ESLint Config",
|
|
9
|
-
"repository":
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/Paratco/javascript.git"
|
|
12
|
+
},
|
|
10
13
|
"keywords": [
|
|
11
14
|
"eslint",
|
|
12
15
|
"eslint-config",
|
|
@@ -20,24 +23,25 @@
|
|
|
20
23
|
"format": "prettier --write src/"
|
|
21
24
|
},
|
|
22
25
|
"peerDependencies": {
|
|
23
|
-
"eslint": "^9.
|
|
24
|
-
"typescript-eslint": "^8.
|
|
26
|
+
"eslint": "^9.12.0",
|
|
27
|
+
"typescript-eslint": "^8.9.0"
|
|
25
28
|
},
|
|
26
29
|
"optionalDependencies": {
|
|
27
30
|
"prettier": "^3.3.3"
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {
|
|
30
|
-
"@eslint/js": "^9.
|
|
31
|
-
"@stylistic/eslint-plugin": "^2.
|
|
33
|
+
"@eslint/js": "^9.13.0",
|
|
34
|
+
"@stylistic/eslint-plugin": "^2.9.0",
|
|
32
35
|
"@types/eslint__js": "^8.42.3",
|
|
33
|
-
"eslint": "^9.
|
|
36
|
+
"eslint": "^9.13.0",
|
|
34
37
|
"eslint-config-prettier": "^9.1.0",
|
|
35
38
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
36
|
-
"eslint-plugin-import-x": "^4.
|
|
37
|
-
"eslint-plugin-react": "^7.
|
|
38
|
-
"eslint-plugin-react-hooks": "
|
|
39
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
40
|
-
"globals": "^15.
|
|
41
|
-
"typescript-eslint": "^8.
|
|
42
|
-
}
|
|
39
|
+
"eslint-plugin-import-x": "^4.3.1",
|
|
40
|
+
"eslint-plugin-react": "^7.37.1",
|
|
41
|
+
"eslint-plugin-react-hooks": "canary",
|
|
42
|
+
"eslint-plugin-react-refresh": "^0.4.13",
|
|
43
|
+
"globals": "^15.11.0",
|
|
44
|
+
"typescript-eslint": "^8.10.0"
|
|
45
|
+
},
|
|
46
|
+
"packageManager": "yarn@4.5.1"
|
|
43
47
|
}
|
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/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
|
+
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Plugins
|
|
2
|
-
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
-
|
|
4
|
-
export default [eslintConfigPrettier];
|
|
1
|
+
// Plugins
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
+
|
|
4
|
+
export default [eslintConfigPrettier];
|
package/src/configs/react.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
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
|
-
];
|
|
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
|
+
];
|
|
@@ -1,33 +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: "never",
|
|
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
|
-
];
|
|
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: "never",
|
|
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
|
+
];
|
|
@@ -98,8 +98,8 @@ export default {
|
|
|
98
98
|
// Disallow duplicate class members.
|
|
99
99
|
// https://typescript-eslint.io/rules/no-dupe-class-members
|
|
100
100
|
// Note: you must disable the base rule as it can report incorrect errors
|
|
101
|
-
"no-dupe-class-members": "
|
|
102
|
-
"@typescript-eslint/no-dupe-class-members": ["
|
|
101
|
+
"no-dupe-class-members": "off",
|
|
102
|
+
"@typescript-eslint/no-dupe-class-members": ["off"],
|
|
103
103
|
|
|
104
104
|
// Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
|
|
105
105
|
// https://typescript-eslint.io/rules/no-import-type-side-effects
|