@paratco/eslint-config 1.0.16 → 2.1.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/dist/configs/base.d.ts +124 -0
- package/dist/configs/base.d.ts.map +1 -0
- package/dist/configs/base.js +21 -0
- package/dist/configs/import.d.ts +83 -0
- package/dist/configs/import.d.ts.map +1 -0
- package/dist/configs/import.js +41 -0
- package/dist/configs/node.d.ts +203 -0
- package/dist/configs/node.d.ts.map +1 -0
- package/{src → dist}/configs/node.js +3 -5
- package/dist/configs/prettierFormatter.d.ts +4 -0
- package/dist/configs/prettierFormatter.d.ts.map +1 -0
- package/{src → dist}/configs/prettierFormatter.js +0 -1
- package/dist/configs/react.d.ts +2863 -0
- package/dist/configs/react.d.ts.map +1 -0
- package/dist/configs/react.js +51 -0
- package/dist/configs/stylisticFormatter.d.ts +218 -0
- package/dist/configs/stylisticFormatter.d.ts.map +1 -0
- package/dist/configs/stylisticFormatter.js +29 -0
- package/dist/index.d.ts +3484 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/rules/import.d.ts +59 -0
- package/dist/rules/import.d.ts.map +1 -0
- package/dist/rules/import.js +139 -0
- package/dist/rules/javascript.d.ts +23 -0
- package/dist/rules/javascript.d.ts.map +1 -0
- package/dist/rules/javascript.js +42 -0
- package/dist/rules/react.d.ts +112 -0
- package/dist/rules/react.d.ts.map +1 -0
- package/dist/rules/react.js +330 -0
- package/dist/rules/stylistic.d.ts +208 -0
- package/dist/rules/stylistic.d.ts.map +1 -0
- package/dist/rules/stylistic.js +439 -0
- package/dist/rules/typescript.d.ts +96 -0
- package/dist/rules/typescript.d.ts.map +1 -0
- package/dist/rules/typescript.js +254 -0
- package/package.json +25 -12
- package/.github/dependabot.yml +0 -14
- package/.github/workflows/publish.yml +0 -52
- package/.prettierrc.json +0 -22
- package/.yarnrc.yml +0 -1
- package/index.js +0 -15
- package/prettier/README.md +0 -22
- package/prettier/index.json +0 -22
- package/prettier/package.json +0 -20
- package/src/configs/base.js +0 -25
- package/src/configs/import.js +0 -43
- package/src/configs/react.js +0 -58
- package/src/configs/stylisticFormatter.js +0 -33
- package/src/lints/import/index.js +0 -175
- package/src/lints/javascript/index.js +0 -46
- package/src/lints/react/index.js +0 -425
- package/src/lints/stylistic/index.js +0 -529
- package/src/lints/typescript/index.js +0 -295
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
// Enforce that class methods utilize this.
|
|
3
|
+
// https://typescript-eslint.io/rules/class-methods-use-this
|
|
4
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
5
|
+
"class-methods-use-this": "off",
|
|
6
|
+
"@typescript-eslint/class-methods-use-this": [
|
|
7
|
+
"error",
|
|
8
|
+
{
|
|
9
|
+
ignoreOverrideMethods: true,
|
|
10
|
+
ignoreClassesThatImplementAnInterface: true
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
// Require return statements to either always or never specify values
|
|
14
|
+
// https://typescript-eslint.io/rules/consistent-return/
|
|
15
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
16
|
+
"consistent-return": "off",
|
|
17
|
+
"@typescript-eslint/consistent-return": "off",
|
|
18
|
+
// Enforce consistent usage of type exports.
|
|
19
|
+
// https://typescript-eslint.io/rules/consistent-type-exports
|
|
20
|
+
"@typescript-eslint/consistent-type-exports": [
|
|
21
|
+
"error",
|
|
22
|
+
{
|
|
23
|
+
fixMixedExportsWithInlineTypeSpecifier: true
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
// Enforce consistent usage of type imports.
|
|
27
|
+
// https://typescript-eslint.io/rules/consistent-type-imports
|
|
28
|
+
"@typescript-eslint/consistent-type-imports": ["error"],
|
|
29
|
+
// Enforce default parameters to be last.
|
|
30
|
+
// https://typescript-eslint.io/rules/default-param-last
|
|
31
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
32
|
+
"default-param-last": "off",
|
|
33
|
+
"@typescript-eslint/default-param-last": ["error"],
|
|
34
|
+
// Require explicit return types on functions and class methods.
|
|
35
|
+
// https://typescript-eslint.io/rules/explicit-function-return-type
|
|
36
|
+
"@typescript-eslint/explicit-function-return-type": [
|
|
37
|
+
"error",
|
|
38
|
+
{
|
|
39
|
+
allowExpressions: true
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
// Require explicit accessibility modifiers on class properties and methods.
|
|
43
|
+
// https://typescript-eslint.io/rules/explicit-member-accessibility
|
|
44
|
+
"@typescript-eslint/explicit-member-accessibility": [
|
|
45
|
+
"error",
|
|
46
|
+
{
|
|
47
|
+
accessibility: "no-public",
|
|
48
|
+
overrides: {
|
|
49
|
+
constructors: "off"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
// Require explicit return and argument types on exported functions' and classes' public class methods.
|
|
54
|
+
// https://typescript-eslint.io/rules/explicit-module-boundary-types
|
|
55
|
+
"@typescript-eslint/explicit-module-boundary-types": ["error"],
|
|
56
|
+
// Require or disallow initialization in variable declarations.
|
|
57
|
+
// https://typescript-eslint.io/rules/init-declarations
|
|
58
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
59
|
+
"init-declarations": "off",
|
|
60
|
+
"@typescript-eslint/init-declarations": ["off"],
|
|
61
|
+
// Enforce a maximum number of parameters in function definitions.
|
|
62
|
+
// https://typescript-eslint.io/rules/max-params
|
|
63
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
64
|
+
"max-params": "off",
|
|
65
|
+
"@typescript-eslint/max-params": ["off"],
|
|
66
|
+
// Require a consistent member declaration order.
|
|
67
|
+
// https://typescript-eslint.io/rules/member-ordering
|
|
68
|
+
"@typescript-eslint/member-ordering": [
|
|
69
|
+
"error",
|
|
70
|
+
{ default: ["constructor", "field", "static-method", "method", "signature"] }
|
|
71
|
+
],
|
|
72
|
+
// Enforce using a particular method signature syntax.
|
|
73
|
+
// https://typescript-eslint.io/rules/method-signature-style
|
|
74
|
+
"@typescript-eslint/method-signature-style": ["error"],
|
|
75
|
+
// Enforce naming conventions for everything across a codebase.
|
|
76
|
+
// https://typescript-eslint.io/rules/naming-convention
|
|
77
|
+
// TODO: We can split this rule. for components it enforces PascalCase and functions camelCase
|
|
78
|
+
"@typescript-eslint/naming-convention": [
|
|
79
|
+
"error",
|
|
80
|
+
{
|
|
81
|
+
selector: "function",
|
|
82
|
+
format: ["PascalCase", "camelCase"]
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
// Disallow duplicate class members.
|
|
86
|
+
// https://typescript-eslint.io/rules/no-dupe-class-members
|
|
87
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
88
|
+
"no-dupe-class-members": "off",
|
|
89
|
+
"@typescript-eslint/no-dupe-class-members": ["off"],
|
|
90
|
+
// Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
|
|
91
|
+
// https://typescript-eslint.io/rules/no-import-type-side-effects
|
|
92
|
+
"@typescript-eslint/no-import-type-side-effects": ["error"],
|
|
93
|
+
// Disallow this keywords outside of classes or class-like objects.
|
|
94
|
+
// https://typescript-eslint.io/rules/no-invalid-this
|
|
95
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
96
|
+
"no-invalid-this": "off",
|
|
97
|
+
"@typescript-eslint/no-invalid-this": ["error"],
|
|
98
|
+
// Disallow function declarations that contain unsafe references inside loop statements.
|
|
99
|
+
// https://typescript-eslint.io/rules/no-loop-func
|
|
100
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
101
|
+
"no-loop-func": "off",
|
|
102
|
+
"@typescript-eslint/no-loop-func": ["error"],
|
|
103
|
+
// Disallow magic numbers.
|
|
104
|
+
// https://typescript-eslint.io/rules/no-magic-numbers
|
|
105
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
106
|
+
"no-magic-numbers": "off",
|
|
107
|
+
"@typescript-eslint/no-magic-numbers": ["off"],
|
|
108
|
+
// Disallow variable redeclaration.
|
|
109
|
+
// https://typescript-eslint.io/rules/no-redeclare
|
|
110
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
111
|
+
"no-redeclare": "off",
|
|
112
|
+
"@typescript-eslint/no-redeclare": ["off"],
|
|
113
|
+
// Disallow invocation of require().
|
|
114
|
+
// https://typescript-eslint.io/rules/no-require-imports
|
|
115
|
+
// Added to recommended
|
|
116
|
+
// "@typescript-eslint/no-require-imports": ["error"],
|
|
117
|
+
// Disallow specified modules when loaded by import.
|
|
118
|
+
// https://typescript-eslint.io/rules/no-restricted-imports
|
|
119
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
120
|
+
"no-restricted-imports": "off",
|
|
121
|
+
"@typescript-eslint/no-restricted-imports": [
|
|
122
|
+
"error",
|
|
123
|
+
{
|
|
124
|
+
patterns: [
|
|
125
|
+
{
|
|
126
|
+
regex: "^(node:)?process$",
|
|
127
|
+
message: "Please dont import node:process."
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
// Disallow certain types
|
|
133
|
+
// https://typescript-eslint.io/rules/no-restricted-types/
|
|
134
|
+
// "@typescript-eslint/no-restricted-types": ["off"],
|
|
135
|
+
// Disallow variable declarations from shadowing variables declared in the outer scope.
|
|
136
|
+
// https://typescript-eslint.io/rules/no-shadow
|
|
137
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
138
|
+
"no-shadow": "off",
|
|
139
|
+
"@typescript-eslint/no-shadow": ["error"],
|
|
140
|
+
// https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment/
|
|
141
|
+
// Disallow unnecessary assignment of constructor property parameter
|
|
142
|
+
"@typescript-eslint/no-unnecessary-parameter-property-assignment": ["off"],
|
|
143
|
+
// Disallow unnecessary namespace qualifiers.
|
|
144
|
+
// https://typescript-eslint.io/rules/no-unnecessary-qualifier
|
|
145
|
+
"@typescript-eslint/no-unnecessary-qualifier": ["warn"],
|
|
146
|
+
// Disallow type assertions that narrow a type
|
|
147
|
+
// https://typescript-eslint.io/rules/no-unsafe-type-assertion/
|
|
148
|
+
"@typescript-eslint/no-unsafe-type-assertion": ["error"],
|
|
149
|
+
// Require unary negation to take a number.
|
|
150
|
+
// https://typescript-eslint.io/rules/no-unsafe-unary-minus
|
|
151
|
+
// Added to recommended
|
|
152
|
+
// "@typescript-eslint/no-unsafe-unary-minus": ["error"],
|
|
153
|
+
// Disallow unused expressions.
|
|
154
|
+
// https://typescript-eslint.io/rules/no-unused-expressions
|
|
155
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
156
|
+
// Added to recommended
|
|
157
|
+
// "no-unused-expressions": "off",
|
|
158
|
+
// "@typescript-eslint/no-unused-expressions": ["off"],
|
|
159
|
+
// Disallow the use of variables before they are defined.
|
|
160
|
+
// https://typescript-eslint.io/rules/no-use-before-define
|
|
161
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
162
|
+
"no-use-before-define": "off",
|
|
163
|
+
"@typescript-eslint/no-use-before-define": ["error"],
|
|
164
|
+
// Disallow empty exports that don't change anything in a module file.
|
|
165
|
+
// https://typescript-eslint.io/rules/no-useless-empty-export
|
|
166
|
+
"@typescript-eslint/no-useless-empty-export": ["warn"],
|
|
167
|
+
// Require or disallow parameter properties in class constructors.
|
|
168
|
+
// https://typescript-eslint.io/rules/parameter-properties
|
|
169
|
+
"@typescript-eslint/parameter-properties": ["error"],
|
|
170
|
+
// Require destructuring from arrays and/or objects.
|
|
171
|
+
// https://typescript-eslint.io/rules/prefer-destructuring
|
|
172
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
173
|
+
"prefer-destructuring": "off",
|
|
174
|
+
"@typescript-eslint/prefer-destructuring": ["off"],
|
|
175
|
+
// Require each enum member value to be explicitly initialized.
|
|
176
|
+
// https://typescript-eslint.io/rules/prefer-enum-initializers
|
|
177
|
+
"@typescript-eslint/prefer-enum-initializers": ["off"],
|
|
178
|
+
// Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result.
|
|
179
|
+
// https://typescript-eslint.io/rules/prefer-find
|
|
180
|
+
// Added to stylistic
|
|
181
|
+
// "@typescript-eslint/prefer-find": ["warn"],
|
|
182
|
+
// Require private members to be marked as readonly if they're never modified outside the constructor.
|
|
183
|
+
// https://typescript-eslint.io/rules/prefer-readonly
|
|
184
|
+
"@typescript-eslint/prefer-readonly": ["warn"],
|
|
185
|
+
// Require function parameters to be typed as readonly to prevent accidental mutation of inputs.
|
|
186
|
+
// https://typescript-eslint.io/rules/prefer-readonly-parameter-types
|
|
187
|
+
"@typescript-eslint/prefer-readonly-parameter-types": ["off"],
|
|
188
|
+
// Enforce RegExp#exec over String#match if no global flag is provided.
|
|
189
|
+
// https://typescript-eslint.io/rules/prefer-regexp-exec
|
|
190
|
+
// Added to stylistic
|
|
191
|
+
// "@typescript-eslint/prefer-regexp-exec": ["warn"],
|
|
192
|
+
// Require any function or method that returns a Promise to be marked async.
|
|
193
|
+
// https://typescript-eslint.io/rules/promise-function-async
|
|
194
|
+
"@typescript-eslint/promise-function-async": ["error"],
|
|
195
|
+
// Require Array#sort and Array#toSorted calls to always provide a compareFunction.
|
|
196
|
+
// https://typescript-eslint.io/rules/require-array-sort-compare
|
|
197
|
+
"@typescript-eslint/require-array-sort-compare": ["error"],
|
|
198
|
+
// Enforce consistent returning of awaited values.
|
|
199
|
+
// https://typescript-eslint.io/rules/return-await
|
|
200
|
+
// Note: you must disable the base rule as it can report incorrect errors
|
|
201
|
+
// Added to recommended
|
|
202
|
+
// "no-return-await": "off",
|
|
203
|
+
// "@typescript-eslint/return-await": ["off"],
|
|
204
|
+
// Disallow certain types in boolean expressions.
|
|
205
|
+
// https://typescript-eslint.io/rules/strict-boolean-expressions
|
|
206
|
+
"@typescript-eslint/strict-boolean-expressions": [
|
|
207
|
+
"error",
|
|
208
|
+
{
|
|
209
|
+
allowString: false,
|
|
210
|
+
allowNumber: false,
|
|
211
|
+
allowNullableObject: false
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
// Require switch-case statements to be exhaustive.
|
|
215
|
+
// https://typescript-eslint.io/rules/switch-exhaustiveness-check
|
|
216
|
+
"@typescript-eslint/switch-exhaustiveness-check": ["error"],
|
|
217
|
+
// Require type annotations in certain places.
|
|
218
|
+
// https://typescript-eslint.io/rules/typedef
|
|
219
|
+
"@typescript-eslint/typedef": ["off"],
|
|
220
|
+
// Additional rules (Customize rules that are not in predefined configs)
|
|
221
|
+
// Enforce template literal expressions to be of string type.
|
|
222
|
+
// https://typescript-eslint.io/rules/restrict-template-expressions
|
|
223
|
+
"@typescript-eslint/restrict-template-expressions": [
|
|
224
|
+
"error",
|
|
225
|
+
{
|
|
226
|
+
allowBoolean: true,
|
|
227
|
+
allowNumber: true,
|
|
228
|
+
allowRegExp: true
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
// Disallow type parameters that aren't used multiple times
|
|
232
|
+
// https://typescript-eslint.io/rules/no-unnecessary-type-parameters
|
|
233
|
+
// Note: This rule is in the strict rules. But we decided to disable this rule.
|
|
234
|
+
"@typescript-eslint/no-unnecessary-type-parameters": ["off"],
|
|
235
|
+
// Disallow unused variables.
|
|
236
|
+
// https://typescript-eslint.io/rules/no-unused-vars
|
|
237
|
+
// Note: This rule is in the recommended rules. But we modify it.
|
|
238
|
+
"no-unused-vars": ["off"],
|
|
239
|
+
"@typescript-eslint/no-unused-vars": [
|
|
240
|
+
"error",
|
|
241
|
+
{
|
|
242
|
+
args: "all",
|
|
243
|
+
argsIgnorePattern: "^_",
|
|
244
|
+
caughtErrors: "all",
|
|
245
|
+
caughtErrorsIgnorePattern: "^_",
|
|
246
|
+
destructuredArrayIgnorePattern: "^_",
|
|
247
|
+
ignoreRestSiblings: true
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
// Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects
|
|
251
|
+
// https://typescript-eslint.io/rules/prefer-optional-chain
|
|
252
|
+
// Note: This rule is in the recommended rules. But we remove it.
|
|
253
|
+
"@typescript-eslint/prefer-optional-chain": ["off"]
|
|
254
|
+
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paratco/eslint-config",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "index.js",
|
|
6
5
|
"author": "Paratco",
|
|
7
6
|
"license": "ISC",
|
|
8
7
|
"description": "Paratco ESLint Config",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
9
19
|
"repository": {
|
|
10
20
|
"type": "git",
|
|
11
21
|
"url": "https://github.com/Paratco/javascript.git"
|
|
@@ -23,28 +33,31 @@
|
|
|
23
33
|
},
|
|
24
34
|
"scripts": {
|
|
25
35
|
"lint": "eslint . --report-unused-disable-directives-severity error --max-warnings 0",
|
|
26
|
-
"format": "prettier --write src/"
|
|
36
|
+
"format": "prettier --write src/",
|
|
37
|
+
"build": "tsc"
|
|
27
38
|
},
|
|
28
39
|
"peerDependencies": {
|
|
29
|
-
"eslint": "^9.
|
|
30
|
-
"typescript-eslint": "^8.
|
|
40
|
+
"eslint": "^9.24.0",
|
|
41
|
+
"typescript-eslint": "^8.29.0"
|
|
31
42
|
},
|
|
32
43
|
"optionalDependencies": {
|
|
33
44
|
"prettier": "^3.5.3"
|
|
34
45
|
},
|
|
35
46
|
"dependencies": {
|
|
36
|
-
"@eslint/js": "^9.
|
|
47
|
+
"@eslint/js": "^9.24.0",
|
|
37
48
|
"@stylistic/eslint-plugin": "^4.2.0",
|
|
38
|
-
"eslint": "^9.
|
|
49
|
+
"eslint": "^9.24.0",
|
|
39
50
|
"eslint-config-prettier": "^10.1.1",
|
|
40
|
-
"eslint-import-resolver-typescript": "^3.
|
|
41
|
-
"eslint-plugin-import-x": "^4.
|
|
42
|
-
"eslint-plugin-react": "^7.37.
|
|
51
|
+
"eslint-import-resolver-typescript": "^4.3.1",
|
|
52
|
+
"eslint-plugin-import-x": "^4.10.1",
|
|
53
|
+
"eslint-plugin-react": "^7.37.5",
|
|
43
54
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
44
55
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
45
56
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
46
57
|
"globals": "^16.0.0",
|
|
47
|
-
"typescript-eslint": "^8.
|
|
58
|
+
"typescript-eslint": "^8.29.0"
|
|
48
59
|
},
|
|
49
|
-
"
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"typescript": "^5.8.3"
|
|
62
|
+
}
|
|
50
63
|
}
|
package/.github/dependabot.yml
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
name: Publish Package 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
|
-
packages: write
|
|
14
|
-
contents: read
|
|
15
|
-
id-token: write
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- name: Check out the repo
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
|
|
21
|
-
- name: Check build version
|
|
22
|
-
uses: actions/github-script@v7
|
|
23
|
-
with:
|
|
24
|
-
script: |
|
|
25
|
-
try {
|
|
26
|
-
const fs = require("fs")
|
|
27
|
-
const jsonString = fs.readFileSync("package.json")
|
|
28
|
-
const package = JSON.parse(jsonString)
|
|
29
|
-
if (package.version !== "${{ github.ref_name }}") {
|
|
30
|
-
core.setFailed(`package.json version (${package.version}) not match version of release (${{ github.ref_name }})`)
|
|
31
|
-
}
|
|
32
|
-
} catch(err) {
|
|
33
|
-
core.setFailed(err)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
- name: Setup Node
|
|
37
|
-
uses: actions/setup-node@v4
|
|
38
|
-
with:
|
|
39
|
-
node-version: 22
|
|
40
|
-
check-latest: 'true'
|
|
41
|
-
registry-url: https://registry.npmjs.org/
|
|
42
|
-
|
|
43
|
-
- name: Enable Yarn
|
|
44
|
-
run: corepack enable
|
|
45
|
-
|
|
46
|
-
- name: Install dependencies
|
|
47
|
-
run: yarn install
|
|
48
|
-
|
|
49
|
-
- name: Publish
|
|
50
|
-
run: npm publish --provenance --access public
|
|
51
|
-
env:
|
|
52
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_WRITE_TOKEN }}
|
package/.prettierrc.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|
package/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import baseConfig from "./src/configs/base.js";
|
|
2
|
-
import reactConfig from "./src/configs/react.js";
|
|
3
|
-
import nodeConfig from "./src/configs/node.js";
|
|
4
|
-
import importConfig from "./src/configs/import.js";
|
|
5
|
-
import prettierFormatter from "./src/configs/prettierFormatter.js";
|
|
6
|
-
import stylisticFormatter from "./src/configs/stylisticFormatter.js";
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
base: baseConfig,
|
|
10
|
-
react: reactConfig,
|
|
11
|
-
node: nodeConfig,
|
|
12
|
-
import: importConfig,
|
|
13
|
-
prettierFormatter,
|
|
14
|
-
stylisticFormatter
|
|
15
|
-
};
|
package/prettier/README.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import eslint from "@eslint/js";
|
|
2
|
-
import tsEslint from "typescript-eslint";
|
|
3
|
-
|
|
4
|
-
// Custom Rules
|
|
5
|
-
import javascriptRules from "../lints/javascript/index.js";
|
|
6
|
-
import typescriptRules from "../lints/typescript/index.js";
|
|
7
|
-
|
|
8
|
-
export default [
|
|
9
|
-
// Set predefined configs
|
|
10
|
-
eslint.configs.recommended,
|
|
11
|
-
...tsEslint.configs.strictTypeChecked,
|
|
12
|
-
...tsEslint.configs.stylisticTypeChecked,
|
|
13
|
-
|
|
14
|
-
// JavaScript Rules
|
|
15
|
-
{
|
|
16
|
-
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
17
|
-
rules: javascriptRules
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
// TypeScript Rules
|
|
21
|
-
{
|
|
22
|
-
files: ["**/*.{ts,tsx}"],
|
|
23
|
-
rules: typescriptRules
|
|
24
|
-
}
|
|
25
|
-
];
|
package/src/configs/import.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import eslintPluginImportX from "eslint-plugin-import-x";
|
|
2
|
-
import unusedImports from "eslint-plugin-unused-imports";
|
|
3
|
-
|
|
4
|
-
// Custom Rules
|
|
5
|
-
import importXRules from "../lints/import/index.js";
|
|
6
|
-
|
|
7
|
-
export default [
|
|
8
|
-
// ESLint Plugin Import
|
|
9
|
-
{
|
|
10
|
-
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
11
|
-
plugins: {
|
|
12
|
-
"import-x": eslintPluginImportX,
|
|
13
|
-
"unused-imports": unusedImports
|
|
14
|
-
},
|
|
15
|
-
settings: {
|
|
16
|
-
"import-x/resolver": {
|
|
17
|
-
typescript: {
|
|
18
|
-
alwaysTryTypes: true
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
rules: {
|
|
23
|
-
...eslintPluginImportX.configs.recommended.rules,
|
|
24
|
-
...importXRules,
|
|
25
|
-
|
|
26
|
-
// unused-imports
|
|
27
|
-
"no-unused-vars": ["off"],
|
|
28
|
-
"@typescript-eslint/no-unused-vars": ["off"],
|
|
29
|
-
"unused-imports/no-unused-imports": ["error"],
|
|
30
|
-
"unused-imports/no-unused-vars": [
|
|
31
|
-
"error",
|
|
32
|
-
{
|
|
33
|
-
args: "all",
|
|
34
|
-
argsIgnorePattern: "^_",
|
|
35
|
-
caughtErrors: "all",
|
|
36
|
-
caughtErrorsIgnorePattern: "^_",
|
|
37
|
-
destructuredArrayIgnorePattern: "^_",
|
|
38
|
-
ignoreRestSiblings: true
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
];
|
package/src/configs/react.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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
|
-
];
|