@stanlemon/eslint-config 0.1.88 → 0.1.89
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/index.js +24 -13
- package/package.json +6 -5
package/index.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
const fs = require("fs");
|
|
2
|
-
|
|
3
|
-
const dir = process.cwd();
|
|
4
|
-
|
|
5
|
-
const tsconfig = dir + "/tsconfig.json";
|
|
6
|
-
const tsconfigEslint = dir + "/tsconfig.eslint.json";
|
|
7
|
-
|
|
8
|
-
// If there is a tsconfig.eslint file, use that instead of the main one
|
|
9
|
-
// See: https://github.com/typescript-eslint/typescript-eslint/blob/main/docs/linting/TYPED_LINTING.md
|
|
10
|
-
const tsProject = fs.existsSync(tsconfigEslint) ? tsconfigEslint : tsconfig;
|
|
11
|
-
|
|
12
1
|
module.exports = {
|
|
13
2
|
env: {
|
|
14
|
-
|
|
3
|
+
es2022: true,
|
|
15
4
|
browser: true,
|
|
16
5
|
node: true,
|
|
17
6
|
jest: true,
|
|
18
7
|
},
|
|
8
|
+
parserOptions: {
|
|
9
|
+
sourceType: "module",
|
|
10
|
+
},
|
|
19
11
|
extends: [
|
|
20
|
-
"
|
|
12
|
+
"eslint:recommended",
|
|
21
13
|
"plugin:jest/recommended",
|
|
22
14
|
"plugin:jest-dom/recommended",
|
|
23
15
|
"plugin:prettier/recommended",
|
|
16
|
+
"plugin:react/recommended",
|
|
17
|
+
"plugin:react/jsx-runtime",
|
|
18
|
+
"typescript",
|
|
19
|
+
"typescript/react",
|
|
24
20
|
],
|
|
21
|
+
plugins: ["import"],
|
|
22
|
+
settings: {
|
|
23
|
+
react: {
|
|
24
|
+
version: "detect",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
25
27
|
rules: {
|
|
26
28
|
// Requires strict equality
|
|
27
29
|
eqeqeq: "error",
|
|
@@ -38,6 +40,9 @@ module.exports = {
|
|
|
38
40
|
"no-console": "warn",
|
|
39
41
|
// Requires the displayName property to be set, not ideal for stateless components
|
|
40
42
|
"react/display-name": "off",
|
|
43
|
+
"react/react-in-jsx-scope": "off",
|
|
44
|
+
"react/jsx-uses-react": "off",
|
|
45
|
+
"react/prop-types": "off",
|
|
41
46
|
// Allow exporting of unnamed objects as a default
|
|
42
47
|
"import/no-anonymous-default-export": [
|
|
43
48
|
"error",
|
|
@@ -45,12 +50,18 @@ module.exports = {
|
|
|
45
50
|
allowObject: true,
|
|
46
51
|
},
|
|
47
52
|
],
|
|
53
|
+
"import/first": "error",
|
|
54
|
+
"import/no-amd": "error",
|
|
55
|
+
"import/no-webpack-loader-syntax": "error",
|
|
56
|
+
"import/no-unused-modules": "error",
|
|
48
57
|
"prettier/prettier": [
|
|
49
58
|
"error",
|
|
50
59
|
{
|
|
51
60
|
trailingComma: "es5",
|
|
52
61
|
},
|
|
53
62
|
],
|
|
63
|
+
"no-unused-vars": "warn",
|
|
64
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
54
65
|
},
|
|
55
66
|
overrides: [
|
|
56
67
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stanlemon/eslint-config",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.89",
|
|
4
4
|
"description": "My typical eslint setup, but without all the copy and paste.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"author": "Stan Lemon <stanlemon@users.noreply.github.com>",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"engines": {
|
|
11
|
-
"node": ">=
|
|
11
|
+
"node": ">=18.0"
|
|
12
12
|
},
|
|
13
13
|
"type": "commonjs",
|
|
14
14
|
"scripts": {
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/eslint-parser": "^7.22.15",
|
|
20
|
-
"@typescript-eslint/eslint-plugin": "^6.7.
|
|
21
|
-
"@typescript-eslint/parser": "^6.7.
|
|
20
|
+
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
|
21
|
+
"@typescript-eslint/parser": "^6.7.2",
|
|
22
22
|
"eslint": "^8.49.0",
|
|
23
23
|
"eslint-config-prettier": "^9.0.0",
|
|
24
|
-
"eslint-config-react
|
|
24
|
+
"eslint-config-react": "^1.1.7",
|
|
25
|
+
"eslint-config-typescript": "^3.0.0",
|
|
25
26
|
"eslint-plugin-import": "^2.28.1",
|
|
26
27
|
"eslint-plugin-jest": "^27.4.0",
|
|
27
28
|
"eslint-plugin-jest-dom": "^5.1.0",
|