eslint-plugin-nextfriday 0.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/LICENSE +21 -0
- package/README.md +179 -0
- package/docs/rules/FILE_KEBAB_CASE.md +75 -0
- package/docs/rules/JSX_PASCAL_CASE.md +69 -0
- package/docs/rules/MD_FILENAME_CASE_RESTRICTION.md +88 -0
- package/docs/rules/NO_EMOJI.md +31 -0
- package/docs/rules/NO_EXPLICIT_RETURN_TYPE.md +71 -0
- package/docs/rules/PREFER_DESTRUCTURING_PARAMS.md +63 -0
- package/docs/rules/PREFER_IMPORT_TYPE.md +85 -0
- package/lib/index.cjs +550 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +62 -0
- package/lib/index.d.ts +62 -0
- package/lib/index.js +511 -0
- package/lib/index.js.map +1 -0
- package/package.json +116 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
|
+
import { TSESLint } from '@typescript-eslint/utils';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
declare const configs: {
|
|
10
|
+
base: {
|
|
11
|
+
plugins: {
|
|
12
|
+
nextfriday: {
|
|
13
|
+
rules: Record<string, _typescript_eslint_utils_ts_eslint.RuleModule<string, readonly unknown[], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
rules: Record<string, string>;
|
|
17
|
+
};
|
|
18
|
+
"base/recommended": {
|
|
19
|
+
plugins: {
|
|
20
|
+
nextfriday: {
|
|
21
|
+
rules: Record<string, _typescript_eslint_utils_ts_eslint.RuleModule<string, readonly unknown[], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>>;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
rules: Record<string, string>;
|
|
25
|
+
};
|
|
26
|
+
react: {
|
|
27
|
+
plugins: {
|
|
28
|
+
nextfriday: {
|
|
29
|
+
rules: Record<string, _typescript_eslint_utils_ts_eslint.RuleModule<string, readonly unknown[], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
rules: Record<string, string>;
|
|
33
|
+
};
|
|
34
|
+
"react/recommended": {
|
|
35
|
+
plugins: {
|
|
36
|
+
nextfriday: {
|
|
37
|
+
rules: Record<string, _typescript_eslint_utils_ts_eslint.RuleModule<string, readonly unknown[], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>>;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
rules: Record<string, string>;
|
|
41
|
+
};
|
|
42
|
+
nextjs: {
|
|
43
|
+
plugins: {
|
|
44
|
+
nextfriday: {
|
|
45
|
+
rules: Record<string, _typescript_eslint_utils_ts_eslint.RuleModule<string, readonly unknown[], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>>;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
rules: Record<string, string>;
|
|
49
|
+
};
|
|
50
|
+
"nextjs/recommended": {
|
|
51
|
+
plugins: {
|
|
52
|
+
nextfriday: {
|
|
53
|
+
rules: Record<string, _typescript_eslint_utils_ts_eslint.RuleModule<string, readonly unknown[], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>>;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
rules: Record<string, string>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
declare const rules: Record<string, TSESLint.RuleModule<string, readonly unknown[]>>;
|
|
61
|
+
|
|
62
|
+
export { configs, meta, rules };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
// package.json
|
|
2
|
+
var package_default = {
|
|
3
|
+
name: "eslint-plugin-nextfriday",
|
|
4
|
+
version: "0.1.0",
|
|
5
|
+
description: "A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.",
|
|
6
|
+
keywords: [
|
|
7
|
+
"eslint",
|
|
8
|
+
"eslintplugin",
|
|
9
|
+
"eslint-plugin",
|
|
10
|
+
"nextfriday",
|
|
11
|
+
"next-friday",
|
|
12
|
+
"linting",
|
|
13
|
+
"code-quality",
|
|
14
|
+
"javascript",
|
|
15
|
+
"typescript",
|
|
16
|
+
"development-tools"
|
|
17
|
+
],
|
|
18
|
+
homepage: "https://github.com/next-friday/eslint-plugin-nextfriday",
|
|
19
|
+
bugs: {
|
|
20
|
+
url: "https://github.com/next-friday/eslint-plugin-nextfriday/issues"
|
|
21
|
+
},
|
|
22
|
+
repository: {
|
|
23
|
+
type: "git",
|
|
24
|
+
url: "https://github.com/next-friday/eslint-plugin-nextfriday.git"
|
|
25
|
+
},
|
|
26
|
+
license: "MIT",
|
|
27
|
+
author: "Next Friday <nextfriday.developer@gmail.com>",
|
|
28
|
+
contributors: [
|
|
29
|
+
"@joetakara"
|
|
30
|
+
],
|
|
31
|
+
type: "module",
|
|
32
|
+
exports: {
|
|
33
|
+
".": {
|
|
34
|
+
types: "./lib/index.d.ts",
|
|
35
|
+
import: "./lib/index.js",
|
|
36
|
+
require: "./lib/index.cjs"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
main: "lib/index.js",
|
|
40
|
+
types: "lib/index.d.ts",
|
|
41
|
+
files: [
|
|
42
|
+
"LICENSE",
|
|
43
|
+
"README.md",
|
|
44
|
+
"CHANGELOG.md",
|
|
45
|
+
"docs",
|
|
46
|
+
"lib"
|
|
47
|
+
],
|
|
48
|
+
scripts: {
|
|
49
|
+
build: "tsup",
|
|
50
|
+
changeset: "changeset",
|
|
51
|
+
"changeset:publish": "npm publish --provenance --access public",
|
|
52
|
+
"changeset:version": "changeset version",
|
|
53
|
+
clear: "rm -rf lib node_modules/.cache .eslintcache",
|
|
54
|
+
eslint: "eslint src --ext .js,.ts,.mjs --fix",
|
|
55
|
+
"eslint:check": "eslint src --ext .js,.ts,.mjs",
|
|
56
|
+
preinstall: "npx only-allow pnpm",
|
|
57
|
+
prepare: "husky",
|
|
58
|
+
prepublishOnly: "pnpm run build",
|
|
59
|
+
prettier: "prettier --write .",
|
|
60
|
+
"prettier:check": "prettier --check .",
|
|
61
|
+
"sort-package-json": "pnpm exec sort-package-json",
|
|
62
|
+
"sort-package-json:check": "pnpm exec sort-package-json --check",
|
|
63
|
+
test: "jest",
|
|
64
|
+
"test:coverage": "jest --coverage",
|
|
65
|
+
"test:watch": "jest --watch",
|
|
66
|
+
typecheck: "tsc --noEmit"
|
|
67
|
+
},
|
|
68
|
+
dependencies: {
|
|
69
|
+
"@typescript-eslint/utils": "^8.42.0",
|
|
70
|
+
"emoji-regex": "^10.5.0",
|
|
71
|
+
tsup: "^8.5.0"
|
|
72
|
+
},
|
|
73
|
+
devDependencies: {
|
|
74
|
+
"@changesets/changelog-github": "^0.5.1",
|
|
75
|
+
"@changesets/cli": "^2.29.6",
|
|
76
|
+
"@commitlint/cli": "^19.8.1",
|
|
77
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
78
|
+
"@eslint/js": "^9.35.0",
|
|
79
|
+
"@jest/globals": "^30.1.2",
|
|
80
|
+
"@stylistic/eslint-plugin": "^3.1.0",
|
|
81
|
+
"@swc/core": "^1.13.5",
|
|
82
|
+
"@types/eslint": "^9.6.1",
|
|
83
|
+
"@types/jest": "^30.0.0",
|
|
84
|
+
"@types/node": "^22.5.4",
|
|
85
|
+
"@types/ramda": "^0.31.0",
|
|
86
|
+
"@typescript-eslint/parser": "^8.42.0",
|
|
87
|
+
"@typescript-eslint/rule-tester": "^8.42.0",
|
|
88
|
+
eslint: "^9.35.0",
|
|
89
|
+
"eslint-config-airbnb-extended": "^2.2.0",
|
|
90
|
+
"eslint-config-prettier": "^10.1.8",
|
|
91
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
92
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
93
|
+
"eslint-plugin-jest": "^29.0.1",
|
|
94
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
95
|
+
"eslint-plugin-sonarjs": "^3.0.5",
|
|
96
|
+
husky: "^9.1.7",
|
|
97
|
+
jest: "^29.7.0",
|
|
98
|
+
"lint-staged": "^16.1.6",
|
|
99
|
+
prettier: "^3.6.2",
|
|
100
|
+
"sort-package-json": "^3.4.0",
|
|
101
|
+
"ts-jest": "^29.4.1",
|
|
102
|
+
"ts-node": "^10.9.2",
|
|
103
|
+
typescript: "^5.6.2",
|
|
104
|
+
"typescript-eslint": "^8.42.0"
|
|
105
|
+
},
|
|
106
|
+
peerDependencies: {
|
|
107
|
+
eslint: "^9.0.0"
|
|
108
|
+
},
|
|
109
|
+
packageManager: "pnpm@9.12.0",
|
|
110
|
+
engines: {
|
|
111
|
+
node: ">=22.0.0",
|
|
112
|
+
pnpm: ">=9.0.0"
|
|
113
|
+
},
|
|
114
|
+
publishConfig: {
|
|
115
|
+
access: "public"
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// src/meta.ts
|
|
120
|
+
var meta = {
|
|
121
|
+
name: package_default.name,
|
|
122
|
+
version: package_default.version
|
|
123
|
+
};
|
|
124
|
+
var meta_default = meta;
|
|
125
|
+
|
|
126
|
+
// src/rules/no-emoji.ts
|
|
127
|
+
import emojiRegex from "emoji-regex";
|
|
128
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
129
|
+
var createRule = ESLintUtils.RuleCreator(
|
|
130
|
+
(name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`
|
|
131
|
+
);
|
|
132
|
+
var noEmoji = createRule({
|
|
133
|
+
name: "no-emoji",
|
|
134
|
+
meta: {
|
|
135
|
+
type: "problem",
|
|
136
|
+
docs: {
|
|
137
|
+
description: "Disallow emoji characters in source code"
|
|
138
|
+
},
|
|
139
|
+
messages: {
|
|
140
|
+
noEmoji: "Emoji are not allowed in source code"
|
|
141
|
+
},
|
|
142
|
+
schema: []
|
|
143
|
+
},
|
|
144
|
+
defaultOptions: [],
|
|
145
|
+
create(context) {
|
|
146
|
+
const { sourceCode } = context;
|
|
147
|
+
return {
|
|
148
|
+
Program() {
|
|
149
|
+
const text = sourceCode.getText();
|
|
150
|
+
const regex = emojiRegex();
|
|
151
|
+
const matches = Array.from(text.matchAll(regex));
|
|
152
|
+
matches.forEach((match) => {
|
|
153
|
+
const loc = sourceCode.getLocFromIndex(match.index);
|
|
154
|
+
context.report({
|
|
155
|
+
loc,
|
|
156
|
+
messageId: "noEmoji"
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
var no_emoji_default = noEmoji;
|
|
164
|
+
|
|
165
|
+
// src/rules/file-kebab-case.ts
|
|
166
|
+
import path from "path";
|
|
167
|
+
import { ESLintUtils as ESLintUtils2 } from "@typescript-eslint/utils";
|
|
168
|
+
var createRule2 = ESLintUtils2.RuleCreator(
|
|
169
|
+
(name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`
|
|
170
|
+
);
|
|
171
|
+
var isKebabCase = (str) => {
|
|
172
|
+
if (/\.(config|rc|setup|spec|test)$/.test(str)) {
|
|
173
|
+
return /^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+)*$/.test(str);
|
|
174
|
+
}
|
|
175
|
+
return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(str);
|
|
176
|
+
};
|
|
177
|
+
var fileKebabCase = createRule2({
|
|
178
|
+
name: "file-kebab-case",
|
|
179
|
+
meta: {
|
|
180
|
+
type: "problem",
|
|
181
|
+
docs: {
|
|
182
|
+
description: "Enforce kebab-case filenames for .ts and .js files"
|
|
183
|
+
},
|
|
184
|
+
messages: {
|
|
185
|
+
fileKebabCase: "File names must be kebab-case"
|
|
186
|
+
},
|
|
187
|
+
schema: []
|
|
188
|
+
},
|
|
189
|
+
defaultOptions: [],
|
|
190
|
+
create(context) {
|
|
191
|
+
return {
|
|
192
|
+
Program() {
|
|
193
|
+
const { filename } = context;
|
|
194
|
+
const ext = path.extname(filename);
|
|
195
|
+
if (ext !== ".ts" && ext !== ".js") {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const basename = path.basename(filename, ext);
|
|
199
|
+
if (!isKebabCase(basename)) {
|
|
200
|
+
context.report({
|
|
201
|
+
loc: { line: 1, column: 0 },
|
|
202
|
+
messageId: "fileKebabCase"
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
var file_kebab_case_default = fileKebabCase;
|
|
210
|
+
|
|
211
|
+
// src/rules/jsx-pascal-case.ts
|
|
212
|
+
import path2 from "path";
|
|
213
|
+
import { ESLintUtils as ESLintUtils3 } from "@typescript-eslint/utils";
|
|
214
|
+
var createRule3 = ESLintUtils3.RuleCreator(
|
|
215
|
+
(name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`
|
|
216
|
+
);
|
|
217
|
+
var isPascalCase = (str) => /^[A-Z][a-zA-Z0-9]*$/.test(str) && !/^[A-Z]+$/.test(str);
|
|
218
|
+
var jsxPascalCase = createRule3({
|
|
219
|
+
name: "jsx-pascal-case",
|
|
220
|
+
meta: {
|
|
221
|
+
type: "problem",
|
|
222
|
+
docs: {
|
|
223
|
+
description: "Enforce PascalCase filenames for .jsx and .tsx files"
|
|
224
|
+
},
|
|
225
|
+
messages: {
|
|
226
|
+
jsxPascalCase: "JSX/TSX file names must be PascalCase"
|
|
227
|
+
},
|
|
228
|
+
schema: []
|
|
229
|
+
},
|
|
230
|
+
defaultOptions: [],
|
|
231
|
+
create(context) {
|
|
232
|
+
return {
|
|
233
|
+
Program() {
|
|
234
|
+
const { filename } = context;
|
|
235
|
+
const ext = path2.extname(filename);
|
|
236
|
+
if (ext !== ".jsx" && ext !== ".tsx") {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
const basename = path2.basename(filename, ext);
|
|
240
|
+
if (!isPascalCase(basename)) {
|
|
241
|
+
context.report({
|
|
242
|
+
loc: { line: 1, column: 0 },
|
|
243
|
+
messageId: "jsxPascalCase"
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
var jsx_pascal_case_default = jsxPascalCase;
|
|
251
|
+
|
|
252
|
+
// src/rules/prefer-destructuring-params.ts
|
|
253
|
+
import { AST_NODE_TYPES, ESLintUtils as ESLintUtils4 } from "@typescript-eslint/utils";
|
|
254
|
+
var createRule4 = ESLintUtils4.RuleCreator(
|
|
255
|
+
(name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`
|
|
256
|
+
);
|
|
257
|
+
var preferDestructuringParams = createRule4({
|
|
258
|
+
name: "prefer-destructuring-params",
|
|
259
|
+
meta: {
|
|
260
|
+
type: "suggestion",
|
|
261
|
+
docs: {
|
|
262
|
+
description: "Enforce destructuring for functions with multiple parameters"
|
|
263
|
+
},
|
|
264
|
+
messages: {
|
|
265
|
+
preferDestructuring: "Functions with multiple parameters should use destructuring"
|
|
266
|
+
},
|
|
267
|
+
schema: []
|
|
268
|
+
},
|
|
269
|
+
defaultOptions: [],
|
|
270
|
+
create(context) {
|
|
271
|
+
const checkFunction = (node) => {
|
|
272
|
+
if (node.params.length <= 1) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const hasNonDestructuredParams = node.params.some(
|
|
276
|
+
(param) => param.type !== AST_NODE_TYPES.ObjectPattern && param.type !== AST_NODE_TYPES.RestElement
|
|
277
|
+
);
|
|
278
|
+
if (hasNonDestructuredParams) {
|
|
279
|
+
context.report({
|
|
280
|
+
node,
|
|
281
|
+
messageId: "preferDestructuring"
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
return {
|
|
286
|
+
FunctionDeclaration: checkFunction,
|
|
287
|
+
FunctionExpression: checkFunction,
|
|
288
|
+
ArrowFunctionExpression: checkFunction
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
var prefer_destructuring_params_default = preferDestructuringParams;
|
|
293
|
+
|
|
294
|
+
// src/rules/no-explicit-return-type.ts
|
|
295
|
+
import { ESLintUtils as ESLintUtils5 } from "@typescript-eslint/utils";
|
|
296
|
+
var createRule5 = ESLintUtils5.RuleCreator(
|
|
297
|
+
(name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`
|
|
298
|
+
);
|
|
299
|
+
var noExplicitReturnType = createRule5({
|
|
300
|
+
name: "no-explicit-return-type",
|
|
301
|
+
meta: {
|
|
302
|
+
type: "suggestion",
|
|
303
|
+
docs: {
|
|
304
|
+
description: "Disallow explicit return types on functions"
|
|
305
|
+
},
|
|
306
|
+
fixable: "code",
|
|
307
|
+
schema: [],
|
|
308
|
+
messages: {
|
|
309
|
+
noExplicitReturnType: "Remove explicit return type '{{returnType}}' - TypeScript can infer it automatically"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
defaultOptions: [],
|
|
313
|
+
create(context) {
|
|
314
|
+
const checkFunction = (node) => {
|
|
315
|
+
if (node.returnType) {
|
|
316
|
+
const returnTypeText = context.sourceCode.getText(node.returnType);
|
|
317
|
+
context.report({
|
|
318
|
+
node: node.returnType,
|
|
319
|
+
messageId: "noExplicitReturnType",
|
|
320
|
+
data: {
|
|
321
|
+
returnType: returnTypeText
|
|
322
|
+
},
|
|
323
|
+
fix(fixer) {
|
|
324
|
+
return fixer.remove(node.returnType);
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
return {
|
|
330
|
+
FunctionDeclaration: checkFunction,
|
|
331
|
+
FunctionExpression: checkFunction,
|
|
332
|
+
ArrowFunctionExpression: checkFunction
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
var no_explicit_return_type_default = noExplicitReturnType;
|
|
337
|
+
|
|
338
|
+
// src/rules/prefer-import-type.ts
|
|
339
|
+
import { AST_NODE_TYPES as AST_NODE_TYPES2, ESLintUtils as ESLintUtils6 } from "@typescript-eslint/utils";
|
|
340
|
+
var createRule6 = ESLintUtils6.RuleCreator(
|
|
341
|
+
(name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`
|
|
342
|
+
);
|
|
343
|
+
var preferImportType = createRule6({
|
|
344
|
+
name: "prefer-import-type",
|
|
345
|
+
meta: {
|
|
346
|
+
type: "suggestion",
|
|
347
|
+
docs: {
|
|
348
|
+
description: "Enforce using 'import type' for type-only imports"
|
|
349
|
+
},
|
|
350
|
+
fixable: "code",
|
|
351
|
+
schema: [],
|
|
352
|
+
messages: {
|
|
353
|
+
preferImportType: "Use 'import type' for type-only imports"
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
defaultOptions: [],
|
|
357
|
+
create(context) {
|
|
358
|
+
function checkImportDeclaration(node) {
|
|
359
|
+
if (node.importKind === "type") {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
if (context.filename.includes(".test.") || context.filename.includes(".spec.") || context.filename.includes("__tests__")) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
const isTypeOnlyImport = node.specifiers.every((specifier) => {
|
|
366
|
+
if (specifier.type === AST_NODE_TYPES2.ImportDefaultSpecifier) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
if (specifier.type === AST_NODE_TYPES2.ImportNamespaceSpecifier) {
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
if (specifier.type === AST_NODE_TYPES2.ImportSpecifier) {
|
|
373
|
+
const importedName = specifier.imported.type === AST_NODE_TYPES2.Identifier ? specifier.imported.name : specifier.imported.value;
|
|
374
|
+
return importedName[0] === importedName[0].toUpperCase() && !["ESLintUtils", "RuleTester"].includes(importedName);
|
|
375
|
+
}
|
|
376
|
+
return false;
|
|
377
|
+
});
|
|
378
|
+
if (isTypeOnlyImport) {
|
|
379
|
+
context.report({
|
|
380
|
+
node,
|
|
381
|
+
messageId: "preferImportType",
|
|
382
|
+
fix(fixer) {
|
|
383
|
+
const source = context.sourceCode.getText(node);
|
|
384
|
+
const fixedSource = source.replace(/^import\s+/, "import type ");
|
|
385
|
+
return fixer.replaceText(node, fixedSource);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return {
|
|
391
|
+
ImportDeclaration: checkImportDeclaration
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
var prefer_import_type_default = preferImportType;
|
|
396
|
+
|
|
397
|
+
// src/rules/md-filename-case-restriction.ts
|
|
398
|
+
import path3 from "path";
|
|
399
|
+
import { ESLintUtils as ESLintUtils7 } from "@typescript-eslint/utils";
|
|
400
|
+
var createRule7 = ESLintUtils7.RuleCreator(
|
|
401
|
+
(name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`
|
|
402
|
+
);
|
|
403
|
+
var mdFilenameCaseRestriction = createRule7({
|
|
404
|
+
name: "md-filename-case-restriction",
|
|
405
|
+
meta: {
|
|
406
|
+
type: "problem",
|
|
407
|
+
docs: {
|
|
408
|
+
description: "Enforce .md filenames to be SNAKE_CASE only"
|
|
409
|
+
},
|
|
410
|
+
messages: {
|
|
411
|
+
invalidFilenameCase: "Markdown filename must be SNAKE_CASE (UPPERCASE with underscores). Found: '{{ filename }}'"
|
|
412
|
+
},
|
|
413
|
+
schema: []
|
|
414
|
+
},
|
|
415
|
+
defaultOptions: [],
|
|
416
|
+
create(context) {
|
|
417
|
+
return {
|
|
418
|
+
Program() {
|
|
419
|
+
const { filename } = context;
|
|
420
|
+
if (!filename.endsWith(".md")) {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
const basename = path3.basename(filename, ".md");
|
|
424
|
+
function isSnakeCase(text) {
|
|
425
|
+
return /^[A-Z][A-Z0-9_]*$/.test(text);
|
|
426
|
+
}
|
|
427
|
+
function isValidCase(text) {
|
|
428
|
+
return isSnakeCase(text);
|
|
429
|
+
}
|
|
430
|
+
if (!isValidCase(basename)) {
|
|
431
|
+
context.report({
|
|
432
|
+
node: context.sourceCode.ast,
|
|
433
|
+
messageId: "invalidFilenameCase",
|
|
434
|
+
data: { filename: basename }
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
var md_filename_case_restriction_default = mdFilenameCaseRestriction;
|
|
442
|
+
|
|
443
|
+
// src/rules.ts
|
|
444
|
+
var rules = {
|
|
445
|
+
"file-kebab-case": file_kebab_case_default,
|
|
446
|
+
"jsx-pascal-case": jsx_pascal_case_default,
|
|
447
|
+
"md-filename-case-restriction": md_filename_case_restriction_default,
|
|
448
|
+
"no-emoji": no_emoji_default,
|
|
449
|
+
"no-explicit-return-type": no_explicit_return_type_default,
|
|
450
|
+
"prefer-destructuring-params": prefer_destructuring_params_default,
|
|
451
|
+
"prefer-import-type": prefer_import_type_default
|
|
452
|
+
};
|
|
453
|
+
var rules_default = rules;
|
|
454
|
+
|
|
455
|
+
// src/configs.ts
|
|
456
|
+
var plugin = { rules: rules_default };
|
|
457
|
+
var baseRules = {
|
|
458
|
+
"nextfriday/no-emoji": "warn",
|
|
459
|
+
"nextfriday/file-kebab-case": "warn",
|
|
460
|
+
"nextfriday/md-filename-case-restriction": "warn",
|
|
461
|
+
"nextfriday/prefer-destructuring-params": "warn",
|
|
462
|
+
"nextfriday/no-explicit-return-type": "warn",
|
|
463
|
+
"nextfriday/prefer-import-type": "warn"
|
|
464
|
+
};
|
|
465
|
+
var baseRecommendedRules = {
|
|
466
|
+
"nextfriday/no-emoji": "error",
|
|
467
|
+
"nextfriday/file-kebab-case": "error",
|
|
468
|
+
"nextfriday/md-filename-case-restriction": "error",
|
|
469
|
+
"nextfriday/prefer-destructuring-params": "error",
|
|
470
|
+
"nextfriday/no-explicit-return-type": "error",
|
|
471
|
+
"nextfriday/prefer-import-type": "error"
|
|
472
|
+
};
|
|
473
|
+
var jsxRules = {
|
|
474
|
+
"nextfriday/jsx-pascal-case": "warn"
|
|
475
|
+
};
|
|
476
|
+
var jsxRecommendedRules = {
|
|
477
|
+
"nextfriday/jsx-pascal-case": "error"
|
|
478
|
+
};
|
|
479
|
+
var createConfig = (configRules) => ({
|
|
480
|
+
plugins: {
|
|
481
|
+
nextfriday: plugin
|
|
482
|
+
},
|
|
483
|
+
rules: configRules
|
|
484
|
+
});
|
|
485
|
+
var configs = {
|
|
486
|
+
base: createConfig(baseRules),
|
|
487
|
+
"base/recommended": createConfig(baseRecommendedRules),
|
|
488
|
+
react: createConfig({
|
|
489
|
+
...baseRules,
|
|
490
|
+
...jsxRules
|
|
491
|
+
}),
|
|
492
|
+
"react/recommended": createConfig({
|
|
493
|
+
...baseRecommendedRules,
|
|
494
|
+
...jsxRecommendedRules
|
|
495
|
+
}),
|
|
496
|
+
nextjs: createConfig({
|
|
497
|
+
...baseRules,
|
|
498
|
+
...jsxRules
|
|
499
|
+
}),
|
|
500
|
+
"nextjs/recommended": createConfig({
|
|
501
|
+
...baseRecommendedRules,
|
|
502
|
+
...jsxRecommendedRules
|
|
503
|
+
})
|
|
504
|
+
};
|
|
505
|
+
var configs_default = configs;
|
|
506
|
+
export {
|
|
507
|
+
configs_default as configs,
|
|
508
|
+
meta_default as meta,
|
|
509
|
+
rules_default as rules
|
|
510
|
+
};
|
|
511
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/meta.ts","../src/rules/no-emoji.ts","../src/rules/file-kebab-case.ts","../src/rules/jsx-pascal-case.ts","../src/rules/prefer-destructuring-params.ts","../src/rules/no-explicit-return-type.ts","../src/rules/prefer-import-type.ts","../src/rules/md-filename-case-restriction.ts","../src/rules.ts","../src/configs.ts"],"sourcesContent":["{\n \"name\": \"eslint-plugin-nextfriday\",\n \"version\": \"0.1.0\",\n \"description\": \"A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.\",\n \"keywords\": [\n \"eslint\",\n \"eslintplugin\",\n \"eslint-plugin\",\n \"nextfriday\",\n \"next-friday\",\n \"linting\",\n \"code-quality\",\n \"javascript\",\n \"typescript\",\n \"development-tools\"\n ],\n \"homepage\": \"https://github.com/next-friday/eslint-plugin-nextfriday\",\n \"bugs\": {\n \"url\": \"https://github.com/next-friday/eslint-plugin-nextfriday/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/next-friday/eslint-plugin-nextfriday.git\"\n },\n \"license\": \"MIT\",\n \"author\": \"Next Friday <nextfriday.developer@gmail.com>\",\n \"contributors\": [\n \"@joetakara\"\n ],\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"import\": \"./lib/index.js\",\n \"require\": \"./lib/index.cjs\"\n }\n },\n \"main\": \"lib/index.js\",\n \"types\": \"lib/index.d.ts\",\n \"files\": [\n \"LICENSE\",\n \"README.md\",\n \"CHANGELOG.md\",\n \"docs\",\n \"lib\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"changeset\": \"changeset\",\n \"changeset:publish\": \"npm publish --provenance --access public\",\n \"changeset:version\": \"changeset version\",\n \"clear\": \"rm -rf lib node_modules/.cache .eslintcache\",\n \"eslint\": \"eslint src --ext .js,.ts,.mjs --fix\",\n \"eslint:check\": \"eslint src --ext .js,.ts,.mjs\",\n \"preinstall\": \"npx only-allow pnpm\",\n \"prepare\": \"husky\",\n \"prepublishOnly\": \"pnpm run build\",\n \"prettier\": \"prettier --write .\",\n \"prettier:check\": \"prettier --check .\",\n \"sort-package-json\": \"pnpm exec sort-package-json\",\n \"sort-package-json:check\": \"pnpm exec sort-package-json --check\",\n \"test\": \"jest\",\n \"test:coverage\": \"jest --coverage\",\n \"test:watch\": \"jest --watch\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@typescript-eslint/utils\": \"^8.42.0\",\n \"emoji-regex\": \"^10.5.0\",\n \"tsup\": \"^8.5.0\"\n },\n \"devDependencies\": {\n \"@changesets/changelog-github\": \"^0.5.1\",\n \"@changesets/cli\": \"^2.29.6\",\n \"@commitlint/cli\": \"^19.8.1\",\n \"@commitlint/config-conventional\": \"^19.8.1\",\n \"@eslint/js\": \"^9.35.0\",\n \"@jest/globals\": \"^30.1.2\",\n \"@stylistic/eslint-plugin\": \"^3.1.0\",\n \"@swc/core\": \"^1.13.5\",\n \"@types/eslint\": \"^9.6.1\",\n \"@types/jest\": \"^30.0.0\",\n \"@types/node\": \"^22.5.4\",\n \"@types/ramda\": \"^0.31.0\",\n \"@typescript-eslint/parser\": \"^8.42.0\",\n \"@typescript-eslint/rule-tester\": \"^8.42.0\",\n \"eslint\": \"^9.35.0\",\n \"eslint-config-airbnb-extended\": \"^2.2.0\",\n \"eslint-config-prettier\": \"^10.1.8\",\n \"eslint-import-resolver-typescript\": \"^4.4.4\",\n \"eslint-plugin-import-x\": \"^4.16.1\",\n \"eslint-plugin-jest\": \"^29.0.1\",\n \"eslint-plugin-prettier\": \"^5.5.4\",\n \"eslint-plugin-sonarjs\": \"^3.0.5\",\n \"husky\": \"^9.1.7\",\n \"jest\": \"^29.7.0\",\n \"lint-staged\": \"^16.1.6\",\n \"prettier\": \"^3.6.2\",\n \"sort-package-json\": \"^3.4.0\",\n \"ts-jest\": \"^29.4.1\",\n \"ts-node\": \"^10.9.2\",\n \"typescript\": \"^5.6.2\",\n \"typescript-eslint\": \"^8.42.0\"\n },\n \"peerDependencies\": {\n \"eslint\": \"^9.0.0\"\n },\n \"packageManager\": \"pnpm@9.12.0\",\n \"engines\": {\n \"node\": \">=22.0.0\",\n \"pnpm\": \">=9.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import packageJson from \"../package.json\" assert { type: \"json\" };\n\nconst meta = {\n name: packageJson.name,\n version: packageJson.version,\n};\n\nexport default meta;\n","import emojiRegex from \"emoji-regex\";\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst noEmoji = createRule({\n name: \"no-emoji\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow emoji characters in source code\",\n },\n messages: {\n noEmoji: \"Emoji are not allowed in source code\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n return {\n Program() {\n const text = sourceCode.getText();\n const regex = emojiRegex();\n const matches = Array.from(text.matchAll(regex));\n\n matches.forEach((match) => {\n const loc = sourceCode.getLocFromIndex(match.index);\n\n context.report({\n loc,\n messageId: \"noEmoji\",\n });\n });\n },\n };\n },\n});\n\nexport default noEmoji;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst isKebabCase = (str: string) => {\n if (/\\.(config|rc|setup|spec|test)$/.test(str)) {\n return /^[a-z0-9]+(?:-[a-z0-9]+)*(?:\\.[a-z0-9]+)*$/.test(str);\n }\n return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(str);\n};\n\nconst fileKebabCase = createRule({\n name: \"file-kebab-case\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce kebab-case filenames for .ts and .js files\",\n },\n messages: {\n fileKebabCase: \"File names must be kebab-case\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n const ext = path.extname(filename);\n\n if (ext !== \".ts\" && ext !== \".js\") {\n return;\n }\n\n const basename = path.basename(filename, ext);\n\n if (!isKebabCase(basename)) {\n context.report({\n loc: { line: 1, column: 0 },\n messageId: \"fileKebabCase\",\n });\n }\n },\n };\n },\n});\n\nexport default fileKebabCase;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst isPascalCase = (str: string) => /^[A-Z][a-zA-Z0-9]*$/.test(str) && !/^[A-Z]+$/.test(str);\n\nconst jsxPascalCase = createRule({\n name: \"jsx-pascal-case\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce PascalCase filenames for .jsx and .tsx files\",\n },\n messages: {\n jsxPascalCase: \"JSX/TSX file names must be PascalCase\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n const ext = path.extname(filename);\n\n if (ext !== \".jsx\" && ext !== \".tsx\") {\n return;\n }\n\n const basename = path.basename(filename, ext);\n\n if (!isPascalCase(basename)) {\n context.report({\n loc: { line: 1, column: 0 },\n messageId: \"jsxPascalCase\",\n });\n }\n },\n };\n },\n});\n\nexport default jsxPascalCase;\n","import { AST_NODE_TYPES, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst preferDestructuringParams = createRule({\n name: \"prefer-destructuring-params\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Enforce destructuring for functions with multiple parameters\",\n },\n messages: {\n preferDestructuring: \"Functions with multiple parameters should use destructuring\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const checkFunction = (\n node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression,\n ) => {\n if (node.params.length <= 1) {\n return;\n }\n\n const hasNonDestructuredParams = node.params.some(\n (param: TSESTree.Parameter) =>\n param.type !== AST_NODE_TYPES.ObjectPattern && param.type !== AST_NODE_TYPES.RestElement,\n );\n\n if (hasNonDestructuredParams) {\n context.report({\n node,\n messageId: \"preferDestructuring\",\n });\n }\n };\n\n return {\n FunctionDeclaration: checkFunction,\n FunctionExpression: checkFunction,\n ArrowFunctionExpression: checkFunction,\n };\n },\n});\n\nexport default preferDestructuringParams;\n","import { ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst noExplicitReturnType = createRule({\n name: \"no-explicit-return-type\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow explicit return types on functions\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n noExplicitReturnType: \"Remove explicit return type '{{returnType}}' - TypeScript can infer it automatically\",\n },\n },\n defaultOptions: [],\n create(context) {\n const checkFunction = (\n node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression,\n ) => {\n if (node.returnType) {\n const returnTypeText = context.sourceCode.getText(node.returnType);\n context.report({\n node: node.returnType,\n messageId: \"noExplicitReturnType\",\n data: {\n returnType: returnTypeText,\n },\n fix(fixer) {\n return fixer.remove(node.returnType!);\n },\n });\n }\n };\n\n return {\n FunctionDeclaration: checkFunction,\n FunctionExpression: checkFunction,\n ArrowFunctionExpression: checkFunction,\n };\n },\n});\n\nexport default noExplicitReturnType;\n","import { AST_NODE_TYPES, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst preferImportType = createRule({\n name: \"prefer-import-type\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Enforce using 'import type' for type-only imports\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n preferImportType: \"Use 'import type' for type-only imports\",\n },\n },\n defaultOptions: [],\n create(context) {\n function checkImportDeclaration(node: TSESTree.ImportDeclaration) {\n if (node.importKind === \"type\") {\n return;\n }\n\n if (\n context.filename.includes(\".test.\") ||\n context.filename.includes(\".spec.\") ||\n context.filename.includes(\"__tests__\")\n ) {\n return;\n }\n\n const isTypeOnlyImport = node.specifiers.every((specifier) => {\n if (specifier.type === AST_NODE_TYPES.ImportDefaultSpecifier) {\n return false;\n }\n if (specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier) {\n return false;\n }\n if (specifier.type === AST_NODE_TYPES.ImportSpecifier) {\n const importedName =\n specifier.imported.type === AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value;\n return (\n importedName[0] === importedName[0].toUpperCase() && ![\"ESLintUtils\", \"RuleTester\"].includes(importedName)\n );\n }\n return false;\n });\n\n if (isTypeOnlyImport) {\n context.report({\n node,\n messageId: \"preferImportType\",\n fix(fixer) {\n const source = context.sourceCode.getText(node);\n const fixedSource = source.replace(/^import\\s+/, \"import type \");\n return fixer.replaceText(node, fixedSource);\n },\n });\n }\n }\n\n return {\n ImportDeclaration: checkImportDeclaration,\n };\n },\n});\n\nexport default preferImportType;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst mdFilenameCaseRestriction = createRule({\n name: \"md-filename-case-restriction\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce .md filenames to be SNAKE_CASE only\",\n },\n messages: {\n invalidFilenameCase: \"Markdown filename must be SNAKE_CASE (UPPERCASE with underscores). Found: '{{ filename }}'\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n\n if (!filename.endsWith(\".md\")) {\n return;\n }\n\n const basename = path.basename(filename, \".md\");\n\n function isSnakeCase(text: string): boolean {\n return /^[A-Z][A-Z0-9_]*$/.test(text);\n }\n\n function isValidCase(text: string): boolean {\n return isSnakeCase(text);\n }\n\n if (!isValidCase(basename)) {\n context.report({\n node: context.sourceCode.ast,\n messageId: \"invalidFilenameCase\",\n data: { filename: basename },\n });\n }\n },\n };\n },\n});\n\nexport default mdFilenameCaseRestriction;\n","import noEmoji from \"./rules/no-emoji\";\nimport fileKebabCase from \"./rules/file-kebab-case\";\nimport jsxPascalCase from \"./rules/jsx-pascal-case\";\nimport preferDestructuringParams from \"./rules/prefer-destructuring-params\";\nimport noExplicitReturnType from \"./rules/no-explicit-return-type\";\nimport preferImportType from \"./rules/prefer-import-type\";\nimport mdFilenameCaseRestriction from \"./rules/md-filename-case-restriction\";\n\nimport type { TSESLint } from \"@typescript-eslint/utils\";\n\nconst rules: Record<string, TSESLint.RuleModule<string, readonly unknown[]>> = {\n \"file-kebab-case\": fileKebabCase,\n \"jsx-pascal-case\": jsxPascalCase,\n \"md-filename-case-restriction\": mdFilenameCaseRestriction,\n \"no-emoji\": noEmoji,\n \"no-explicit-return-type\": noExplicitReturnType,\n \"prefer-destructuring-params\": preferDestructuringParams,\n \"prefer-import-type\": preferImportType,\n};\n\nexport default rules;\n","import rules from \"./rules\";\n\nconst plugin = { rules };\n\nconst baseRules = {\n \"nextfriday/no-emoji\": \"warn\",\n \"nextfriday/file-kebab-case\": \"warn\",\n \"nextfriday/md-filename-case-restriction\": \"warn\",\n \"nextfriday/prefer-destructuring-params\": \"warn\",\n \"nextfriday/no-explicit-return-type\": \"warn\",\n \"nextfriday/prefer-import-type\": \"warn\",\n} as const;\n\nconst baseRecommendedRules = {\n \"nextfriday/no-emoji\": \"error\",\n \"nextfriday/file-kebab-case\": \"error\",\n \"nextfriday/md-filename-case-restriction\": \"error\",\n \"nextfriday/prefer-destructuring-params\": \"error\",\n \"nextfriday/no-explicit-return-type\": \"error\",\n \"nextfriday/prefer-import-type\": \"error\",\n} as const;\n\nconst jsxRules = {\n \"nextfriday/jsx-pascal-case\": \"warn\",\n} as const;\n\nconst jsxRecommendedRules = {\n \"nextfriday/jsx-pascal-case\": \"error\",\n} as const;\n\nconst createConfig = (configRules: Record<string, string>) => ({\n plugins: {\n nextfriday: plugin,\n },\n rules: configRules,\n});\n\nconst configs = {\n base: createConfig(baseRules),\n \"base/recommended\": createConfig(baseRecommendedRules),\n react: createConfig({\n ...baseRules,\n ...jsxRules,\n }),\n \"react/recommended\": createConfig({\n ...baseRecommendedRules,\n ...jsxRecommendedRules,\n }),\n nextjs: createConfig({\n ...baseRules,\n ...jsxRules,\n }),\n \"nextjs/recommended\": createConfig({\n ...baseRecommendedRules,\n ...jsxRecommendedRules,\n }),\n};\n\nexport default configs;\n"],"mappings":";AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,SAAW;AAAA,EACX,QAAU;AAAA,EACV,cAAgB;AAAA,IACd;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,EACR,SAAW;AAAA,IACT,KAAK;AAAA,MACH,OAAS;AAAA,MACT,QAAU;AAAA,MACV,SAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,EACR,OAAS;AAAA,EACT,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,E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,UAAU;AAAA,EACd,MAAM,aAAa,SAAS;AAAA,EAC5B,oBAAoB,aAAa,oBAAoB;AAAA,EACrD,OAAO,aAAa;AAAA,IAClB,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AAAA,EACD,qBAAqB,aAAa;AAAA,IAChC,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AAAA,EACD,QAAQ,aAAa;AAAA,IACnB,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AAAA,EACD,sBAAsB,aAAa;AAAA,IACjC,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AACH;AAEA,IAAO,kBAAQ;","names":["ESLintUtils","createRule","path","ESLintUtils","createRule","ESLintUtils","createRule","ESLintUtils","createRule","AST_NODE_TYPES","ESLintUtils","createRule","path","ESLintUtils","createRule"]}
|