@friendsoftheweb/eslint-plugin 0.0.3 → 0.0.4
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/cjs/index.js +123 -40
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +123 -40
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/rules/import-from-utils.d.ts +4 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var path = require('node:path');
|
|
4
3
|
var fs = require('node:fs');
|
|
4
|
+
var path = require('node:path');
|
|
5
5
|
var postcss = require('postcss');
|
|
6
6
|
var selectorParser = require('postcss-selector-parser');
|
|
7
7
|
|
|
8
8
|
var name = "@friendsoftheweb/eslint-plugin";
|
|
9
|
-
var version = "0.0.
|
|
9
|
+
var version = "0.0.4";
|
|
10
10
|
var packageJson = {
|
|
11
11
|
name: name,
|
|
12
12
|
version: version};
|
|
@@ -55,44 +55,6 @@ const banLodashImportRule = {
|
|
|
55
55
|
},
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const cssModuleNameMatchesRule = {
|
|
59
|
-
meta: {
|
|
60
|
-
type: 'problem',
|
|
61
|
-
docs: {
|
|
62
|
-
description: "enforce that a CSS module's filename matches the filename of the importing file",
|
|
63
|
-
url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-name-matches',
|
|
64
|
-
},
|
|
65
|
-
schema: [],
|
|
66
|
-
messages: {
|
|
67
|
-
filenameMismatch: 'CSS module filename "{{cssModuleFilename}}" does not match the current filename "{{filename}}"',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
defaultOptions: [],
|
|
71
|
-
create(context) {
|
|
72
|
-
return {
|
|
73
|
-
ImportDeclaration(node) {
|
|
74
|
-
if (typeof node.source.value !== 'string' ||
|
|
75
|
-
!node.source.value.endsWith('.module.css')) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const filename = path.basename(context.filename, path.extname(context.filename));
|
|
79
|
-
const cssModulePath = node.source.value;
|
|
80
|
-
const cssModuleFilename = path.basename(cssModulePath, '.module.css');
|
|
81
|
-
if (cssModuleFilename !== filename) {
|
|
82
|
-
context.report({
|
|
83
|
-
node,
|
|
84
|
-
messageId: 'filenameMismatch',
|
|
85
|
-
data: {
|
|
86
|
-
cssModuleFilename,
|
|
87
|
-
filename,
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
|
|
96
58
|
const cssModuleClassExistsRule = {
|
|
97
59
|
meta: {
|
|
98
60
|
type: 'problem',
|
|
@@ -255,6 +217,126 @@ const cssModuleClassExistsRule = {
|
|
|
255
217
|
},
|
|
256
218
|
};
|
|
257
219
|
|
|
220
|
+
const cssModuleNameMatchesRule = {
|
|
221
|
+
meta: {
|
|
222
|
+
type: 'problem',
|
|
223
|
+
docs: {
|
|
224
|
+
description: "enforce that a CSS module's filename matches the filename of the importing file",
|
|
225
|
+
url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-name-matches',
|
|
226
|
+
},
|
|
227
|
+
schema: [],
|
|
228
|
+
messages: {
|
|
229
|
+
filenameMismatch: 'CSS module filename "{{cssModuleFilename}}" does not match the current filename "{{filename}}"',
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
defaultOptions: [],
|
|
233
|
+
create(context) {
|
|
234
|
+
return {
|
|
235
|
+
ImportDeclaration(node) {
|
|
236
|
+
if (typeof node.source.value !== 'string' ||
|
|
237
|
+
!node.source.value.endsWith('.module.css')) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const filename = path.basename(context.filename, path.extname(context.filename));
|
|
241
|
+
const cssModulePath = node.source.value;
|
|
242
|
+
const cssModuleFilename = path.basename(cssModulePath, '.module.css');
|
|
243
|
+
if (cssModuleFilename !== filename) {
|
|
244
|
+
context.report({
|
|
245
|
+
node,
|
|
246
|
+
messageId: 'filenameMismatch',
|
|
247
|
+
data: {
|
|
248
|
+
cssModuleFilename,
|
|
249
|
+
filename,
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const functionNames = [
|
|
259
|
+
'buildContentDispositionHeader',
|
|
260
|
+
'createCSVStream',
|
|
261
|
+
'deepCamelCaseKeys',
|
|
262
|
+
'deepPascalCaseKeys',
|
|
263
|
+
'deepSnakeCaseKeys',
|
|
264
|
+
'deepTransformKeys',
|
|
265
|
+
'formatDateForDateInput',
|
|
266
|
+
'formatDateForDateTimeInput',
|
|
267
|
+
'formatDuration',
|
|
268
|
+
'formatFileSize',
|
|
269
|
+
'isPresent',
|
|
270
|
+
'isPresentNumber',
|
|
271
|
+
'isPresentString',
|
|
272
|
+
'parseNullableDate',
|
|
273
|
+
'parseNullableFloat',
|
|
274
|
+
'parseNullableInt',
|
|
275
|
+
'presence',
|
|
276
|
+
'slugify',
|
|
277
|
+
];
|
|
278
|
+
const importFromUtils = {
|
|
279
|
+
meta: {
|
|
280
|
+
type: 'problem',
|
|
281
|
+
fixable: 'code',
|
|
282
|
+
docs: {
|
|
283
|
+
description: 'enforce importing util functions from `@friendsoftheweb/utils`',
|
|
284
|
+
url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebimport-from-utils',
|
|
285
|
+
},
|
|
286
|
+
schema: [],
|
|
287
|
+
messages: {
|
|
288
|
+
invalidImport: '{{functionNames}} must be imported from "@friendsoftheweb/utils"',
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
defaultOptions: [],
|
|
292
|
+
create(context) {
|
|
293
|
+
return {
|
|
294
|
+
ImportDeclaration(node) {
|
|
295
|
+
if (node.importKind === 'type') {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (typeof node.source.value !== 'string' ||
|
|
299
|
+
node.source.value === '@friendsoftheweb/utils') {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
const foundFunctionNames = [];
|
|
303
|
+
for (const specifier of node.specifiers) {
|
|
304
|
+
if (specifier.type === 'ImportSpecifier' &&
|
|
305
|
+
specifier.importKind !== 'type' &&
|
|
306
|
+
specifier.imported.type === 'Identifier' &&
|
|
307
|
+
functionNames.includes(specifier.imported.name)) {
|
|
308
|
+
foundFunctionNames.push(specifier.imported.name);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (foundFunctionNames.length === 0) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
context.report({
|
|
315
|
+
node,
|
|
316
|
+
messageId: 'invalidImport',
|
|
317
|
+
data: {
|
|
318
|
+
functionNames: foundFunctionNames
|
|
319
|
+
.map((name) => `"${name}"`)
|
|
320
|
+
.join(', '),
|
|
321
|
+
},
|
|
322
|
+
fix(fixer) {
|
|
323
|
+
if (typeof node.source.value !== 'string') {
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
if (foundFunctionNames.length < node.specifiers.length) {
|
|
327
|
+
// Don't auto-fix if there are other imports that would be affected
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
const newImportPath = '@friendsoftheweb/utils';
|
|
331
|
+
const quote = node.source.raw[0]; // preserve original quote style
|
|
332
|
+
return fixer.replaceText(node.source, `${quote}${newImportPath}${quote}`);
|
|
333
|
+
},
|
|
334
|
+
});
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
},
|
|
338
|
+
};
|
|
339
|
+
|
|
258
340
|
const noLegacyNodeImportRule = {
|
|
259
341
|
meta: {
|
|
260
342
|
type: 'problem',
|
|
@@ -464,6 +546,7 @@ const plugin = {
|
|
|
464
546
|
'ban-lodash-import': banLodashImportRule,
|
|
465
547
|
'css-module-name-matches': cssModuleNameMatchesRule,
|
|
466
548
|
'css-module-class-exists': cssModuleClassExistsRule,
|
|
549
|
+
'import-from-utils': importFromUtils,
|
|
467
550
|
'no-legacy-node-import': noLegacyNodeImportRule,
|
|
468
551
|
'react-named-func-components': reactNamedFuncComponentsRule,
|
|
469
552
|
'valid-server-actions-path': validServerActionsPathRule,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/rules/ban-lodash-import.ts","../../../../src/rules/css-module-name-matches.ts","../../../../src/rules/css-module-class-exists.ts","../../../../src/rules/no-legacy-node-import.ts","../../../../src/rules/react-named-func-components.ts","../../../../src/rules/valid-server-actions-path.ts","../../../../src/index.ts"],"sourcesContent":["import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst banLodashImportRule: RuleModule<'invalidImport'> = {\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'enforce importing functions from `lodash-es` instead of `lodash`',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebban-lodash-import',\n },\n schema: [],\n messages: {\n invalidImport:\n 'Functions must be imported from \"lodash-es\" instead of \"lodash\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n (node.source.value !== 'lodash' &&\n !node.source.value.startsWith('lodash/'))\n ) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidImport',\n fix(fixer) {\n if (typeof node.source.value !== 'string') {\n return null;\n }\n\n if (node.source.value === 'lodash/fp') {\n return null; // no automatic fix for fp imports\n }\n\n const newImportPath =\n node.source.value === 'lodash'\n ? 'lodash-es'\n : node.source.value.replace(/^lodash\\//, 'lodash-es/');\n\n const quote = node.source.raw[0]; // preserve original quote style\n\n return fixer.replaceText(\n node.source,\n `${quote}${newImportPath}${quote}`,\n );\n },\n });\n },\n };\n },\n};\n\nexport default banLodashImportRule;\n","import path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst cssModuleNameMatchesRule: RuleModule<'filenameMismatch'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n \"enforce that a CSS module's filename matches the filename of the importing file\",\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-name-matches',\n },\n schema: [],\n messages: {\n filenameMismatch:\n 'CSS module filename \"{{cssModuleFilename}}\" does not match the current filename \"{{filename}}\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !node.source.value.endsWith('.module.css')\n ) {\n return;\n }\n\n const filename = path.basename(\n context.filename,\n path.extname(context.filename),\n );\n\n const cssModulePath = node.source.value;\n const cssModuleFilename = path.basename(cssModulePath, '.module.css');\n\n if (cssModuleFilename !== filename) {\n context.report({\n node,\n messageId: 'filenameMismatch',\n data: {\n cssModuleFilename,\n filename,\n },\n });\n }\n },\n };\n },\n};\n\nexport default cssModuleNameMatchesRule;\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\nimport { parse } from 'postcss';\nimport selectorParser from 'postcss-selector-parser';\n\nconst cssModuleClassExistsRule: RuleModule<\n | 'relativePath'\n | 'defaultImport'\n | 'onlyDefaultImport'\n | 'fileDoesNotExist'\n | 'classDoesNotExist'\n> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce that class names used from an imported CSS module exist in the module file',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-class-exists',\n },\n schema: [],\n messages: {\n relativePath:\n 'CSS module import \"{{importPath}}\" should be a relative path',\n defaultImport:\n 'CSS module import \"{{importPath}}\" should have a default import',\n onlyDefaultImport:\n 'CSS module import \"{{importPath}}\" should have only a default import',\n fileDoesNotExist:\n 'CSS module file \"{{absoluteImportPath}}\" does not exist',\n classDoesNotExist:\n 'Class `.{{className}}` does not exist in the CSS module imported as `{{objectName}}`',\n },\n },\n defaultOptions: [],\n create(context) {\n const classNames = {};\n\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !node.source.value.endsWith('.module.css')\n ) {\n return;\n }\n\n const importPath = node.source.value;\n\n if (!(importPath.startsWith('./') || importPath.startsWith('../'))) {\n context.report({\n node,\n messageId: 'relativePath',\n data: { importPath },\n });\n\n return;\n }\n\n if (node.specifiers.length === 0) {\n context.report({\n node,\n messageId: 'defaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n if (node.specifiers.length > 1) {\n context.report({\n node,\n messageId: 'onlyDefaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n const defaultImportSpecifier = node.specifiers.find(\n (specifier) => specifier.type === 'ImportDefaultSpecifier',\n );\n\n if (defaultImportSpecifier == null) {\n context.report({\n node,\n messageId: 'onlyDefaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n const dirname = path.dirname(context.physicalFilename);\n const absoluteImportPath = path.resolve(dirname, importPath);\n\n if (!fs.existsSync(absoluteImportPath)) {\n context.report({\n node,\n messageId: 'fileDoesNotExist',\n data: { absoluteImportPath },\n });\n\n return;\n }\n\n const importName = defaultImportSpecifier.local.name;\n\n classNames[importName] = new Set();\n\n const cssModuleContent = fs.readFileSync(absoluteImportPath, 'utf8');\n const root = parse(cssModuleContent);\n\n for (const node of root.nodes) {\n if (node.type === 'rule') {\n selectorParser(function transform(selectors) {\n selectors.walkClasses((classNode) => {\n classNames[importName].add(classNode.value);\n });\n }).processSync(node.selector);\n } else if (\n node.type === 'atrule' &&\n (node.name === 'media' ||\n node.name === 'container' ||\n node.name === 'layer')\n ) {\n for (const childNode of node.nodes) {\n if (childNode.type !== 'rule') {\n continue;\n }\n\n selectorParser(function transform(selectors) {\n selectors.walkClasses((classNode) => {\n classNames[importName].add(classNode.value);\n });\n }).processSync(childNode.selector);\n }\n }\n }\n },\n MemberExpression(node) {\n if (node.object.type !== 'Identifier') {\n return;\n }\n\n if (classNames[node.object.name] == null) {\n return;\n }\n\n const objectName = node.object.name;\n\n if (node.property.type === 'Identifier') {\n const className = node.property.name;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n\n return;\n }\n\n if (\n node.property.type === 'Literal' &&\n typeof node.property.value === 'string'\n ) {\n const className = node.property.value;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n }\n },\n VariableDeclarator(node) {\n if (node.id.type !== 'ObjectPattern') {\n return;\n }\n\n if (node.init?.type !== 'Identifier') {\n return;\n }\n\n const objectName = node.init.name;\n\n if (classNames[objectName] == null) {\n return;\n }\n\n for (const property of node.id.properties) {\n if (property.type !== 'Property') {\n continue;\n }\n\n if (property.key.type !== 'Identifier') {\n continue;\n }\n\n const className = property.key.name;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node: property,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n }\n },\n };\n },\n};\n\nexport default cssModuleClassExistsRule;\n","import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst noLegacyNodeImportRule: RuleModule<'invalidImport'> = {\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'enforce importing node standard library modules using `node:` prefix',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebno-legacy-node-import',\n },\n schema: [],\n messages: {\n invalidImport:\n 'Node standard library modules must be imported using the \"node:\" prefix',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !NODE_STANDARD_MODULES.includes(node.source.value)\n ) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidImport',\n fix(fixer) {\n if (typeof node.source.value !== 'string') {\n return null;\n }\n\n const newImportPath = `node:${node.source.value}`;\n const quote = node.source.raw[0]; // preserve original quote style\n\n return fixer.replaceText(\n node.source,\n `${quote}${newImportPath}${quote}`,\n );\n },\n });\n },\n };\n },\n};\n\nexport default noLegacyNodeImportRule;\n\nexport const NODE_STANDARD_MODULES = Object.freeze([\n 'assert',\n 'assert/strict',\n 'async_hooks',\n 'buffer',\n 'child_process',\n 'cluster',\n 'console',\n 'crypto',\n 'dns',\n 'dns/promises',\n 'domain',\n 'events',\n 'fs',\n 'fs/promises',\n 'http',\n 'http2',\n 'https',\n 'inspector',\n 'module',\n 'net',\n 'os',\n 'path',\n 'perf_hooks',\n 'process',\n 'punycode',\n 'querystring',\n 'readline',\n 'readline/promises',\n 'repl',\n 'sqlite',\n 'stream',\n 'stream/promises',\n 'string_decoder',\n 'test',\n 'timers',\n 'timers/promises',\n 'tls',\n 'trace_events',\n 'tty',\n 'url',\n 'util',\n 'util/types',\n 'v8',\n 'vm',\n 'wasi',\n 'worker_threads',\n 'zlib',\n]);\n","import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\nimport type {\n ArrowFunctionExpression,\n FunctionDeclaration,\n VariableDeclarator,\n} from 'estree';\n\nconst reactNamedFuncComponentsRule: RuleModule<'invalidComponentDefinition'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce use of named functions when defining React components',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebreact-named-func-components',\n },\n schema: [],\n messages: {\n invalidComponentDefinition:\n 'React components must be defined using named functions',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n VariableDeclarator(node) {\n if (!isReactComponent(node as VariableDeclarator)) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidComponentDefinition',\n });\n },\n };\n },\n};\n\nexport default reactNamedFuncComponentsRule;\n\nfunction isReactComponent(\n node: FunctionDeclaration | ArrowFunctionExpression | VariableDeclarator,\n) {\n if (node.type === 'VariableDeclarator') {\n if (node.init == null) {\n return false;\n }\n\n if (node.init.type !== 'ArrowFunctionExpression') {\n return false;\n }\n\n if (node.id.type !== 'Identifier' || !/^[A-Z]/.test(node.id.name)) {\n return false;\n }\n\n return isReactComponent(node.init);\n } else if (node.type === 'FunctionDeclaration') {\n if (node.id != null && !/^[A-Z]/.test(node.id.name)) {\n return false;\n }\n }\n\n if (node.body.type === 'BlockStatement') {\n for (const statement of node.body.body) {\n if (\n statement.type === 'ReturnStatement' &&\n statement.argument != null &&\n // @ts-expect-error: ESTree types are missing JSXElement\n (statement.argument.type === 'JSXElement' ||\n // @ts-expect-error: ESTree types are missing JSXFragment\n statement.argument.type === 'JSXFragment' ||\n (statement.argument.type === 'Literal' &&\n statement.argument.value === null))\n ) {\n return true;\n }\n }\n // @ts-expect-error: ESTree types are missing JSXElement\n } else if (node.body.type === 'JSXElement') {\n return true;\n } else if (\n // @ts-expect-error: ESTree types are missing ParenthesizedExpression\n node.body.type === 'ParenthesizedExpression' &&\n // @ts-expect-error: ESTree types are missing JSXElement\n node.body.expression?.type === 'JSXElement'\n ) {\n return true;\n }\n\n return false;\n}\n","import path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst validServerActionsPathRule: RuleModule<'invalidPath'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce server actions are exported from file paths that match \"app/**/_actions.ts\" or \"app/**/_actions/**/*.ts\"',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebvalid-server-actions-path',\n },\n schema: [],\n messages: {\n invalidPath:\n 'Server action files must be located in a directory named \"_actions\" or have the filename \"_actions.ts\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ExpressionStatement(node) {\n if (\n node.expression.type !== 'Literal' ||\n node.expression.value !== 'use server'\n ) {\n return;\n }\n\n const basename = path.basename(context.filename);\n const dirname = path.dirname(context.filename);\n\n // Escape backslashes for RegExp (Windows paths)\n const escapedSep = path.sep.replace('\\\\', '\\\\\\\\');\n\n const isInActionsDir = new RegExp(\n `app(${escapedSep}.*)?${escapedSep}_actions`,\n ).test(dirname);\n\n const isActionsFile =\n (dirname === 'app' || new RegExp(`app${escapedSep}`).test(dirname)) &&\n /_actions\\.(js|ts)$/.test(basename);\n\n if (!isInActionsDir && !isActionsFile) {\n context.report({\n node,\n messageId: 'invalidPath',\n });\n }\n },\n };\n },\n};\n\nexport default validServerActionsPathRule;\n","import packageJson from '../package.json' with { type: 'json' };\n\nimport banLodashImport from './rules/ban-lodash-import.ts';\nimport cssModuleNameMatchesRule from './rules/css-module-name-matches.ts';\nimport cssModuleClassExistsRule from './rules/css-module-class-exists.ts';\nimport noLegacyNodeImport from './rules/no-legacy-node-import.ts';\nimport reactNamedFuncComponents from './rules/react-named-func-components.ts';\nimport validServerActionsPathRule from './rules/valid-server-actions-path.ts';\n\nconst plugin = {\n meta: {\n name: packageJson.name,\n version: packageJson.version,\n },\n configs: {},\n rules: {\n 'ban-lodash-import': banLodashImport,\n 'css-module-name-matches': cssModuleNameMatchesRule,\n 'css-module-class-exists': cssModuleClassExistsRule,\n 'no-legacy-node-import': noLegacyNodeImport,\n 'react-named-func-components': reactNamedFuncComponents,\n 'valid-server-actions-path': validServerActionsPathRule,\n },\n};\n\nconst RULE_NAMES = Object.keys(plugin.rules).map(\n (ruleName) => `friendsoftheweb/${ruleName}`,\n);\n\n/**\n * @param {'error' | 'warn'} reportLevel\n */\nfunction buildConfig(reportLevel) {\n return {\n plugins: {\n friendsoftheweb: plugin,\n },\n rules: Object.fromEntries(\n RULE_NAMES.map((ruleName) => [ruleName, reportLevel]),\n ),\n };\n}\n\nconst errorConfig = buildConfig('error');\nconst warnConfig = buildConfig('warn');\n\nconst futureConfig = {\n ...errorConfig,\n rules: {\n ...errorConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'warn',\n },\n};\n\nconst recommendedConfig = {\n ...errorConfig,\n rules: {\n ...errorConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'off',\n },\n};\n\nconst migrateConfig = {\n ...warnConfig,\n rules: {\n ...warnConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'off',\n },\n};\n\nObject.assign(plugin.configs, {\n 'flat/future': [futureConfig],\n 'flat/recommended': [recommendedConfig],\n 'flat/migrate': [migrateConfig],\n future: futureConfig,\n recommended: recommendedConfig,\n migrate: migrateConfig,\n});\n\nexport default plugin;\n"],"names":["parse","banLodashImport","noLegacyNodeImport","reactNamedFuncComponents"],"mappings":";;;;;;;;;;;;;AAEA,MAAM,mBAAmB,GAAgC;AACvD,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,IAAI,EAAE;AACJ,YAAA,WAAW,EACT,kEAAkE;AACpE,YAAA,GAAG,EAAE,mFAAmF;AACzF,SAAA;AACD,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,QAAQ,EAAE;AACR,YAAA,aAAa,EACX,iEAAiE;AACpE,SAAA;AACF,KAAA;AACD,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,MAAM,CAAC,OAAO,EAAA;QACZ,OAAO;AACL,YAAA,iBAAiB,CAAC,IAAI,EAAA;AACpB,gBAAA,IACE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ;AACrC,qBAAC,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ;AAC7B,wBAAA,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAC3C;oBACA;gBACF;gBAEA,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;AACJ,oBAAA,SAAS,EAAE,eAAe;AAC1B,oBAAA,GAAG,CAAC,KAAK,EAAA;wBACP,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE;AACzC,4BAAA,OAAO,IAAI;wBACb;wBAEA,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,WAAW,EAAE;4BACrC,OAAO,IAAI,CAAC;wBACd;wBAEA,MAAM,aAAa,GACjB,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK;AACpB,8BAAE;AACF,8BAAE,IAAI,CAAC,MAAM,CAA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,EAAA,EACpB,6CAA6C,EAAE,KAAK,MAEvD;AAED,MAAM,aAAa,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACd,UAAU,CAAA,EAAA,EACb,KAAK,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACA,UAAU,CAAC,KAAK,CAAA,EAAA,EACnB,6CAA6C,EAAE,KAAK,MAEvD;AAED,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;IAC5B,aAAa,EAAE,CAAC,YAAY,CAAC;IAC7B,kBAAkB,EAAE,CAAC,iBAAiB,CAAC;IACvC,cAAc,EAAE,CAAC,aAAa,CAAC;AAC/B,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,WAAW,EAAE,iBAAiB;AAC9B,IAAA,OAAO,EAAE,aAAa;AACvB,CAAA,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/rules/ban-lodash-import.ts","../../../../src/rules/css-module-class-exists.ts","../../../../src/rules/css-module-name-matches.ts","../../../../src/rules/import-from-utils.ts","../../../../src/rules/no-legacy-node-import.ts","../../../../src/rules/react-named-func-components.ts","../../../../src/rules/valid-server-actions-path.ts","../../../../src/index.ts"],"sourcesContent":["import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst banLodashImportRule: RuleModule<'invalidImport'> = {\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'enforce importing functions from `lodash-es` instead of `lodash`',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebban-lodash-import',\n },\n schema: [],\n messages: {\n invalidImport:\n 'Functions must be imported from \"lodash-es\" instead of \"lodash\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n (node.source.value !== 'lodash' &&\n !node.source.value.startsWith('lodash/'))\n ) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidImport',\n fix(fixer) {\n if (typeof node.source.value !== 'string') {\n return null;\n }\n\n if (node.source.value === 'lodash/fp') {\n return null; // no automatic fix for fp imports\n }\n\n const newImportPath =\n node.source.value === 'lodash'\n ? 'lodash-es'\n : node.source.value.replace(/^lodash\\//, 'lodash-es/');\n\n const quote = node.source.raw[0]; // preserve original quote style\n\n return fixer.replaceText(\n node.source,\n `${quote}${newImportPath}${quote}`,\n );\n },\n });\n },\n };\n },\n};\n\nexport default banLodashImportRule;\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\nimport { parse } from 'postcss';\nimport selectorParser from 'postcss-selector-parser';\n\nconst cssModuleClassExistsRule: RuleModule<\n | 'relativePath'\n | 'defaultImport'\n | 'onlyDefaultImport'\n | 'fileDoesNotExist'\n | 'classDoesNotExist'\n> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce that class names used from an imported CSS module exist in the module file',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-class-exists',\n },\n schema: [],\n messages: {\n relativePath:\n 'CSS module import \"{{importPath}}\" should be a relative path',\n defaultImport:\n 'CSS module import \"{{importPath}}\" should have a default import',\n onlyDefaultImport:\n 'CSS module import \"{{importPath}}\" should have only a default import',\n fileDoesNotExist:\n 'CSS module file \"{{absoluteImportPath}}\" does not exist',\n classDoesNotExist:\n 'Class `.{{className}}` does not exist in the CSS module imported as `{{objectName}}`',\n },\n },\n defaultOptions: [],\n create(context) {\n const classNames = {};\n\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !node.source.value.endsWith('.module.css')\n ) {\n return;\n }\n\n const importPath = node.source.value;\n\n if (!(importPath.startsWith('./') || importPath.startsWith('../'))) {\n context.report({\n node,\n messageId: 'relativePath',\n data: { importPath },\n });\n\n return;\n }\n\n if (node.specifiers.length === 0) {\n context.report({\n node,\n messageId: 'defaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n if (node.specifiers.length > 1) {\n context.report({\n node,\n messageId: 'onlyDefaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n const defaultImportSpecifier = node.specifiers.find(\n (specifier) => specifier.type === 'ImportDefaultSpecifier',\n );\n\n if (defaultImportSpecifier == null) {\n context.report({\n node,\n messageId: 'onlyDefaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n const dirname = path.dirname(context.physicalFilename);\n const absoluteImportPath = path.resolve(dirname, importPath);\n\n if (!fs.existsSync(absoluteImportPath)) {\n context.report({\n node,\n messageId: 'fileDoesNotExist',\n data: { absoluteImportPath },\n });\n\n return;\n }\n\n const importName = defaultImportSpecifier.local.name;\n\n classNames[importName] = new Set();\n\n const cssModuleContent = fs.readFileSync(absoluteImportPath, 'utf8');\n const root = parse(cssModuleContent);\n\n for (const node of root.nodes) {\n if (node.type === 'rule') {\n selectorParser(function transform(selectors) {\n selectors.walkClasses((classNode) => {\n classNames[importName].add(classNode.value);\n });\n }).processSync(node.selector);\n } else if (\n node.type === 'atrule' &&\n (node.name === 'media' ||\n node.name === 'container' ||\n node.name === 'layer')\n ) {\n for (const childNode of node.nodes) {\n if (childNode.type !== 'rule') {\n continue;\n }\n\n selectorParser(function transform(selectors) {\n selectors.walkClasses((classNode) => {\n classNames[importName].add(classNode.value);\n });\n }).processSync(childNode.selector);\n }\n }\n }\n },\n MemberExpression(node) {\n if (node.object.type !== 'Identifier') {\n return;\n }\n\n if (classNames[node.object.name] == null) {\n return;\n }\n\n const objectName = node.object.name;\n\n if (node.property.type === 'Identifier') {\n const className = node.property.name;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n\n return;\n }\n\n if (\n node.property.type === 'Literal' &&\n typeof node.property.value === 'string'\n ) {\n const className = node.property.value;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n }\n },\n VariableDeclarator(node) {\n if (node.id.type !== 'ObjectPattern') {\n return;\n }\n\n if (node.init?.type !== 'Identifier') {\n return;\n }\n\n const objectName = node.init.name;\n\n if (classNames[objectName] == null) {\n return;\n }\n\n for (const property of node.id.properties) {\n if (property.type !== 'Property') {\n continue;\n }\n\n if (property.key.type !== 'Identifier') {\n continue;\n }\n\n const className = property.key.name;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node: property,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n }\n },\n };\n },\n};\n\nexport default cssModuleClassExistsRule;\n","import path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst cssModuleNameMatchesRule: RuleModule<'filenameMismatch'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n \"enforce that a CSS module's filename matches the filename of the importing file\",\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-name-matches',\n },\n schema: [],\n messages: {\n filenameMismatch:\n 'CSS module filename \"{{cssModuleFilename}}\" does not match the current filename \"{{filename}}\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !node.source.value.endsWith('.module.css')\n ) {\n return;\n }\n\n const filename = path.basename(\n context.filename,\n path.extname(context.filename),\n );\n\n const cssModulePath = node.source.value;\n const cssModuleFilename = path.basename(cssModulePath, '.module.css');\n\n if (cssModuleFilename !== filename) {\n context.report({\n node,\n messageId: 'filenameMismatch',\n data: {\n cssModuleFilename,\n filename,\n },\n });\n }\n },\n };\n },\n};\n\nexport default cssModuleNameMatchesRule;\n","import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nexport const functionNames = [\n 'buildContentDispositionHeader',\n 'createCSVStream',\n 'deepCamelCaseKeys',\n 'deepPascalCaseKeys',\n 'deepSnakeCaseKeys',\n 'deepTransformKeys',\n 'formatDateForDateInput',\n 'formatDateForDateTimeInput',\n 'formatDuration',\n 'formatFileSize',\n 'isPresent',\n 'isPresentNumber',\n 'isPresentString',\n 'parseNullableDate',\n 'parseNullableFloat',\n 'parseNullableInt',\n 'presence',\n 'slugify',\n];\n\nconst importFromUtils: RuleModule<'invalidImport'> = {\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'enforce importing util functions from `@friendsoftheweb/utils`',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebimport-from-utils',\n },\n schema: [],\n messages: {\n invalidImport:\n '{{functionNames}} must be imported from \"@friendsoftheweb/utils\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (node.importKind === 'type') {\n return;\n }\n\n if (\n typeof node.source.value !== 'string' ||\n node.source.value === '@friendsoftheweb/utils'\n ) {\n return;\n }\n\n const foundFunctionNames: string[] = [];\n\n for (const specifier of node.specifiers) {\n if (\n specifier.type === 'ImportSpecifier' &&\n specifier.importKind !== 'type' &&\n specifier.imported.type === 'Identifier' &&\n functionNames.includes(specifier.imported.name)\n ) {\n foundFunctionNames.push(specifier.imported.name);\n }\n }\n\n if (foundFunctionNames.length === 0) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidImport',\n data: {\n functionNames: foundFunctionNames\n .map((name) => `\"${name}\"`)\n .join(', '),\n },\n fix(fixer) {\n if (typeof node.source.value !== 'string') {\n return null;\n }\n\n if (foundFunctionNames.length < node.specifiers.length) {\n // Don't auto-fix if there are other imports that would be affected\n return null;\n }\n\n const newImportPath = '@friendsoftheweb/utils';\n const quote = node.source.raw[0]; // preserve original quote style\n\n return fixer.replaceText(\n node.source,\n `${quote}${newImportPath}${quote}`,\n );\n },\n });\n },\n };\n },\n};\n\nexport default importFromUtils;\n","import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst noLegacyNodeImportRule: RuleModule<'invalidImport'> = {\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'enforce importing node standard library modules using `node:` prefix',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebno-legacy-node-import',\n },\n schema: [],\n messages: {\n invalidImport:\n 'Node standard library modules must be imported using the \"node:\" prefix',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !NODE_STANDARD_MODULES.includes(node.source.value)\n ) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidImport',\n fix(fixer) {\n if (typeof node.source.value !== 'string') {\n return null;\n }\n\n const newImportPath = `node:${node.source.value}`;\n const quote = node.source.raw[0]; // preserve original quote style\n\n return fixer.replaceText(\n node.source,\n `${quote}${newImportPath}${quote}`,\n );\n },\n });\n },\n };\n },\n};\n\nexport default noLegacyNodeImportRule;\n\nexport const NODE_STANDARD_MODULES = Object.freeze([\n 'assert',\n 'assert/strict',\n 'async_hooks',\n 'buffer',\n 'child_process',\n 'cluster',\n 'console',\n 'crypto',\n 'dns',\n 'dns/promises',\n 'domain',\n 'events',\n 'fs',\n 'fs/promises',\n 'http',\n 'http2',\n 'https',\n 'inspector',\n 'module',\n 'net',\n 'os',\n 'path',\n 'perf_hooks',\n 'process',\n 'punycode',\n 'querystring',\n 'readline',\n 'readline/promises',\n 'repl',\n 'sqlite',\n 'stream',\n 'stream/promises',\n 'string_decoder',\n 'test',\n 'timers',\n 'timers/promises',\n 'tls',\n 'trace_events',\n 'tty',\n 'url',\n 'util',\n 'util/types',\n 'v8',\n 'vm',\n 'wasi',\n 'worker_threads',\n 'zlib',\n]);\n","import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\nimport type {\n ArrowFunctionExpression,\n FunctionDeclaration,\n VariableDeclarator,\n} from 'estree';\n\nconst reactNamedFuncComponentsRule: RuleModule<'invalidComponentDefinition'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce use of named functions when defining React components',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebreact-named-func-components',\n },\n schema: [],\n messages: {\n invalidComponentDefinition:\n 'React components must be defined using named functions',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n VariableDeclarator(node) {\n if (!isReactComponent(node as VariableDeclarator)) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidComponentDefinition',\n });\n },\n };\n },\n};\n\nexport default reactNamedFuncComponentsRule;\n\nfunction isReactComponent(\n node: FunctionDeclaration | ArrowFunctionExpression | VariableDeclarator,\n) {\n if (node.type === 'VariableDeclarator') {\n if (node.init == null) {\n return false;\n }\n\n if (node.init.type !== 'ArrowFunctionExpression') {\n return false;\n }\n\n if (node.id.type !== 'Identifier' || !/^[A-Z]/.test(node.id.name)) {\n return false;\n }\n\n return isReactComponent(node.init);\n } else if (node.type === 'FunctionDeclaration') {\n if (node.id != null && !/^[A-Z]/.test(node.id.name)) {\n return false;\n }\n }\n\n if (node.body.type === 'BlockStatement') {\n for (const statement of node.body.body) {\n if (\n statement.type === 'ReturnStatement' &&\n statement.argument != null &&\n // @ts-expect-error: ESTree types are missing JSXElement\n (statement.argument.type === 'JSXElement' ||\n // @ts-expect-error: ESTree types are missing JSXFragment\n statement.argument.type === 'JSXFragment' ||\n (statement.argument.type === 'Literal' &&\n statement.argument.value === null))\n ) {\n return true;\n }\n }\n // @ts-expect-error: ESTree types are missing JSXElement\n } else if (node.body.type === 'JSXElement') {\n return true;\n } else if (\n // @ts-expect-error: ESTree types are missing ParenthesizedExpression\n node.body.type === 'ParenthesizedExpression' &&\n // @ts-expect-error: ESTree types are missing JSXElement\n node.body.expression?.type === 'JSXElement'\n ) {\n return true;\n }\n\n return false;\n}\n","import path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst validServerActionsPathRule: RuleModule<'invalidPath'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce server actions are exported from file paths that match \"app/**/_actions.ts\" or \"app/**/_actions/**/*.ts\"',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebvalid-server-actions-path',\n },\n schema: [],\n messages: {\n invalidPath:\n 'Server action files must be located in a directory named \"_actions\" or have the filename \"_actions.ts\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ExpressionStatement(node) {\n if (\n node.expression.type !== 'Literal' ||\n node.expression.value !== 'use server'\n ) {\n return;\n }\n\n const basename = path.basename(context.filename);\n const dirname = path.dirname(context.filename);\n\n // Escape backslashes for RegExp (Windows paths)\n const escapedSep = path.sep.replace('\\\\', '\\\\\\\\');\n\n const isInActionsDir = new RegExp(\n `app(${escapedSep}.*)?${escapedSep}_actions`,\n ).test(dirname);\n\n const isActionsFile =\n (dirname === 'app' || new RegExp(`app${escapedSep}`).test(dirname)) &&\n /_actions\\.(js|ts)$/.test(basename);\n\n if (!isInActionsDir && !isActionsFile) {\n context.report({\n node,\n messageId: 'invalidPath',\n });\n }\n },\n };\n },\n};\n\nexport default validServerActionsPathRule;\n","import packageJson from '../package.json' with { type: 'json' };\n\nimport banLodashImport from './rules/ban-lodash-import.ts';\nimport cssModuleClassExistsRule from './rules/css-module-class-exists.ts';\nimport cssModuleNameMatchesRule from './rules/css-module-name-matches.ts';\nimport importFromUtils from './rules/import-from-utils.ts';\nimport noLegacyNodeImport from './rules/no-legacy-node-import.ts';\nimport reactNamedFuncComponents from './rules/react-named-func-components.ts';\nimport validServerActionsPathRule from './rules/valid-server-actions-path.ts';\n\nconst plugin = {\n meta: {\n name: packageJson.name,\n version: packageJson.version,\n },\n configs: {},\n rules: {\n 'ban-lodash-import': banLodashImport,\n 'css-module-name-matches': cssModuleNameMatchesRule,\n 'css-module-class-exists': cssModuleClassExistsRule,\n 'import-from-utils': importFromUtils,\n 'no-legacy-node-import': noLegacyNodeImport,\n 'react-named-func-components': reactNamedFuncComponents,\n 'valid-server-actions-path': validServerActionsPathRule,\n },\n};\n\nconst RULE_NAMES = Object.keys(plugin.rules).map(\n (ruleName) => `friendsoftheweb/${ruleName}`,\n);\n\n/**\n * @param {'error' | 'warn'} reportLevel\n */\nfunction buildConfig(reportLevel) {\n return {\n plugins: {\n friendsoftheweb: plugin,\n },\n rules: Object.fromEntries(\n RULE_NAMES.map((ruleName) => [ruleName, reportLevel]),\n ),\n };\n}\n\nconst errorConfig = buildConfig('error');\nconst warnConfig = buildConfig('warn');\n\nconst futureConfig = {\n ...errorConfig,\n rules: {\n ...errorConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'warn',\n },\n};\n\nconst recommendedConfig = {\n ...errorConfig,\n rules: {\n ...errorConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'off',\n },\n};\n\nconst migrateConfig = {\n ...warnConfig,\n rules: {\n ...warnConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'off',\n },\n};\n\nObject.assign(plugin.configs, {\n 'flat/future': [futureConfig],\n 'flat/recommended': [recommendedConfig],\n 'flat/migrate': [migrateConfig],\n future: futureConfig,\n recommended: recommendedConfig,\n migrate: migrateConfig,\n});\n\nexport default plugin;\n"],"names":["parse","banLodashImport","noLegacyNodeImport","reactNamedFuncComponents"],"mappings":";;;;;;;;;;;;;AAEA,MAAM,mBAAmB,GAAgC;AACvD,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,IAAI,EAAE;AACJ,YAAA,WAAW,EACT,kEAAkE;AACpE,YAAA,GAAG,EAAE,mFAAmF;AACzF,SAAA;AACD,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,QAAQ,EAAE;AACR,YAAA,aAAa,EACX,iEAAiE;AACpE,SAAA;AACF,KAAA;AACD,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,MAAM,CAAC,OAAO,EAAA;QACZ,OAAO;AACL,YAAA,iBAAiB,CAAC,IAAI,EAAA;AACpB,gBAAA,IACE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ;AACrC,qBAAC,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ;AAC7B,wBAAA,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CA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MAExD;AAED,MAAM,iBAAiB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAClB,WAAW,CAAA,EAAA,EACd,KAAK,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACA,WAAW,CAAC,KAAK,CAAA,EAAA,EACpB,6CAA6C,EAAE,KAAK,MAEvD;AAED,MAAM,aAAa,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACd,UAAU,CAAA,EAAA,EACb,KAAK,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACA,UAAU,CAAC,KAAK,CAAA,EAAA,EACnB,6CAA6C,EAAE,KAAK,MAEvD;AAED,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;IAC5B,aAAa,EAAE,CAAC,YAAY,CAAC;IAC7B,kBAAkB,EAAE,CAAC,iBAAiB,CAAC;IACvC,cAAc,EAAE,CAAC,aAAa,CAAC;AAC/B,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,WAAW,EAAE,iBAAiB;AAC9B,IAAA,OAAO,EAAE,aAAa;AACvB,CAAA,CAAC;;;;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
3
|
import { parse } from 'postcss';
|
|
4
4
|
import selectorParser from 'postcss-selector-parser';
|
|
5
5
|
|
|
6
6
|
var name = "@friendsoftheweb/eslint-plugin";
|
|
7
|
-
var version = "0.0.
|
|
7
|
+
var version = "0.0.4";
|
|
8
8
|
var packageJson = {
|
|
9
9
|
name: name,
|
|
10
10
|
version: version};
|
|
@@ -53,44 +53,6 @@ const banLodashImportRule = {
|
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
const cssModuleNameMatchesRule = {
|
|
57
|
-
meta: {
|
|
58
|
-
type: 'problem',
|
|
59
|
-
docs: {
|
|
60
|
-
description: "enforce that a CSS module's filename matches the filename of the importing file",
|
|
61
|
-
url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-name-matches',
|
|
62
|
-
},
|
|
63
|
-
schema: [],
|
|
64
|
-
messages: {
|
|
65
|
-
filenameMismatch: 'CSS module filename "{{cssModuleFilename}}" does not match the current filename "{{filename}}"',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
defaultOptions: [],
|
|
69
|
-
create(context) {
|
|
70
|
-
return {
|
|
71
|
-
ImportDeclaration(node) {
|
|
72
|
-
if (typeof node.source.value !== 'string' ||
|
|
73
|
-
!node.source.value.endsWith('.module.css')) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const filename = path.basename(context.filename, path.extname(context.filename));
|
|
77
|
-
const cssModulePath = node.source.value;
|
|
78
|
-
const cssModuleFilename = path.basename(cssModulePath, '.module.css');
|
|
79
|
-
if (cssModuleFilename !== filename) {
|
|
80
|
-
context.report({
|
|
81
|
-
node,
|
|
82
|
-
messageId: 'filenameMismatch',
|
|
83
|
-
data: {
|
|
84
|
-
cssModuleFilename,
|
|
85
|
-
filename,
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
|
|
94
56
|
const cssModuleClassExistsRule = {
|
|
95
57
|
meta: {
|
|
96
58
|
type: 'problem',
|
|
@@ -253,6 +215,126 @@ const cssModuleClassExistsRule = {
|
|
|
253
215
|
},
|
|
254
216
|
};
|
|
255
217
|
|
|
218
|
+
const cssModuleNameMatchesRule = {
|
|
219
|
+
meta: {
|
|
220
|
+
type: 'problem',
|
|
221
|
+
docs: {
|
|
222
|
+
description: "enforce that a CSS module's filename matches the filename of the importing file",
|
|
223
|
+
url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-name-matches',
|
|
224
|
+
},
|
|
225
|
+
schema: [],
|
|
226
|
+
messages: {
|
|
227
|
+
filenameMismatch: 'CSS module filename "{{cssModuleFilename}}" does not match the current filename "{{filename}}"',
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
defaultOptions: [],
|
|
231
|
+
create(context) {
|
|
232
|
+
return {
|
|
233
|
+
ImportDeclaration(node) {
|
|
234
|
+
if (typeof node.source.value !== 'string' ||
|
|
235
|
+
!node.source.value.endsWith('.module.css')) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
const filename = path.basename(context.filename, path.extname(context.filename));
|
|
239
|
+
const cssModulePath = node.source.value;
|
|
240
|
+
const cssModuleFilename = path.basename(cssModulePath, '.module.css');
|
|
241
|
+
if (cssModuleFilename !== filename) {
|
|
242
|
+
context.report({
|
|
243
|
+
node,
|
|
244
|
+
messageId: 'filenameMismatch',
|
|
245
|
+
data: {
|
|
246
|
+
cssModuleFilename,
|
|
247
|
+
filename,
|
|
248
|
+
},
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const functionNames = [
|
|
257
|
+
'buildContentDispositionHeader',
|
|
258
|
+
'createCSVStream',
|
|
259
|
+
'deepCamelCaseKeys',
|
|
260
|
+
'deepPascalCaseKeys',
|
|
261
|
+
'deepSnakeCaseKeys',
|
|
262
|
+
'deepTransformKeys',
|
|
263
|
+
'formatDateForDateInput',
|
|
264
|
+
'formatDateForDateTimeInput',
|
|
265
|
+
'formatDuration',
|
|
266
|
+
'formatFileSize',
|
|
267
|
+
'isPresent',
|
|
268
|
+
'isPresentNumber',
|
|
269
|
+
'isPresentString',
|
|
270
|
+
'parseNullableDate',
|
|
271
|
+
'parseNullableFloat',
|
|
272
|
+
'parseNullableInt',
|
|
273
|
+
'presence',
|
|
274
|
+
'slugify',
|
|
275
|
+
];
|
|
276
|
+
const importFromUtils = {
|
|
277
|
+
meta: {
|
|
278
|
+
type: 'problem',
|
|
279
|
+
fixable: 'code',
|
|
280
|
+
docs: {
|
|
281
|
+
description: 'enforce importing util functions from `@friendsoftheweb/utils`',
|
|
282
|
+
url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebimport-from-utils',
|
|
283
|
+
},
|
|
284
|
+
schema: [],
|
|
285
|
+
messages: {
|
|
286
|
+
invalidImport: '{{functionNames}} must be imported from "@friendsoftheweb/utils"',
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
defaultOptions: [],
|
|
290
|
+
create(context) {
|
|
291
|
+
return {
|
|
292
|
+
ImportDeclaration(node) {
|
|
293
|
+
if (node.importKind === 'type') {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
if (typeof node.source.value !== 'string' ||
|
|
297
|
+
node.source.value === '@friendsoftheweb/utils') {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const foundFunctionNames = [];
|
|
301
|
+
for (const specifier of node.specifiers) {
|
|
302
|
+
if (specifier.type === 'ImportSpecifier' &&
|
|
303
|
+
specifier.importKind !== 'type' &&
|
|
304
|
+
specifier.imported.type === 'Identifier' &&
|
|
305
|
+
functionNames.includes(specifier.imported.name)) {
|
|
306
|
+
foundFunctionNames.push(specifier.imported.name);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (foundFunctionNames.length === 0) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
context.report({
|
|
313
|
+
node,
|
|
314
|
+
messageId: 'invalidImport',
|
|
315
|
+
data: {
|
|
316
|
+
functionNames: foundFunctionNames
|
|
317
|
+
.map((name) => `"${name}"`)
|
|
318
|
+
.join(', '),
|
|
319
|
+
},
|
|
320
|
+
fix(fixer) {
|
|
321
|
+
if (typeof node.source.value !== 'string') {
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
324
|
+
if (foundFunctionNames.length < node.specifiers.length) {
|
|
325
|
+
// Don't auto-fix if there are other imports that would be affected
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
const newImportPath = '@friendsoftheweb/utils';
|
|
329
|
+
const quote = node.source.raw[0]; // preserve original quote style
|
|
330
|
+
return fixer.replaceText(node.source, `${quote}${newImportPath}${quote}`);
|
|
331
|
+
},
|
|
332
|
+
});
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
|
|
256
338
|
const noLegacyNodeImportRule = {
|
|
257
339
|
meta: {
|
|
258
340
|
type: 'problem',
|
|
@@ -462,6 +544,7 @@ const plugin = {
|
|
|
462
544
|
'ban-lodash-import': banLodashImportRule,
|
|
463
545
|
'css-module-name-matches': cssModuleNameMatchesRule,
|
|
464
546
|
'css-module-class-exists': cssModuleClassExistsRule,
|
|
547
|
+
'import-from-utils': importFromUtils,
|
|
465
548
|
'no-legacy-node-import': noLegacyNodeImportRule,
|
|
466
549
|
'react-named-func-components': reactNamedFuncComponentsRule,
|
|
467
550
|
'valid-server-actions-path': validServerActionsPathRule,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/rules/ban-lodash-import.ts","../../../../src/rules/css-module-name-matches.ts","../../../../src/rules/css-module-class-exists.ts","../../../../src/rules/no-legacy-node-import.ts","../../../../src/rules/react-named-func-components.ts","../../../../src/rules/valid-server-actions-path.ts","../../../../src/index.ts"],"sourcesContent":["import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst banLodashImportRule: RuleModule<'invalidImport'> = {\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'enforce importing functions from `lodash-es` instead of `lodash`',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebban-lodash-import',\n },\n schema: [],\n messages: {\n invalidImport:\n 'Functions must be imported from \"lodash-es\" instead of \"lodash\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n (node.source.value !== 'lodash' &&\n !node.source.value.startsWith('lodash/'))\n ) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidImport',\n fix(fixer) {\n if (typeof node.source.value !== 'string') {\n return null;\n }\n\n if (node.source.value === 'lodash/fp') {\n return null; // no automatic fix for fp imports\n }\n\n const newImportPath =\n node.source.value === 'lodash'\n ? 'lodash-es'\n : node.source.value.replace(/^lodash\\//, 'lodash-es/');\n\n const quote = node.source.raw[0]; // preserve original quote style\n\n return fixer.replaceText(\n node.source,\n `${quote}${newImportPath}${quote}`,\n );\n },\n });\n },\n };\n },\n};\n\nexport default banLodashImportRule;\n","import path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst cssModuleNameMatchesRule: RuleModule<'filenameMismatch'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n \"enforce that a CSS module's filename matches the filename of the importing file\",\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-name-matches',\n },\n schema: [],\n messages: {\n filenameMismatch:\n 'CSS module filename \"{{cssModuleFilename}}\" does not match the current filename \"{{filename}}\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !node.source.value.endsWith('.module.css')\n ) {\n return;\n }\n\n const filename = path.basename(\n context.filename,\n path.extname(context.filename),\n );\n\n const cssModulePath = node.source.value;\n const cssModuleFilename = path.basename(cssModulePath, '.module.css');\n\n if (cssModuleFilename !== filename) {\n context.report({\n node,\n messageId: 'filenameMismatch',\n data: {\n cssModuleFilename,\n filename,\n },\n });\n }\n },\n };\n },\n};\n\nexport default cssModuleNameMatchesRule;\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\nimport { parse } from 'postcss';\nimport selectorParser from 'postcss-selector-parser';\n\nconst cssModuleClassExistsRule: RuleModule<\n | 'relativePath'\n | 'defaultImport'\n | 'onlyDefaultImport'\n | 'fileDoesNotExist'\n | 'classDoesNotExist'\n> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce that class names used from an imported CSS module exist in the module file',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-class-exists',\n },\n schema: [],\n messages: {\n relativePath:\n 'CSS module import \"{{importPath}}\" should be a relative path',\n defaultImport:\n 'CSS module import \"{{importPath}}\" should have a default import',\n onlyDefaultImport:\n 'CSS module import \"{{importPath}}\" should have only a default import',\n fileDoesNotExist:\n 'CSS module file \"{{absoluteImportPath}}\" does not exist',\n classDoesNotExist:\n 'Class `.{{className}}` does not exist in the CSS module imported as `{{objectName}}`',\n },\n },\n defaultOptions: [],\n create(context) {\n const classNames = {};\n\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !node.source.value.endsWith('.module.css')\n ) {\n return;\n }\n\n const importPath = node.source.value;\n\n if (!(importPath.startsWith('./') || importPath.startsWith('../'))) {\n context.report({\n node,\n messageId: 'relativePath',\n data: { importPath },\n });\n\n return;\n }\n\n if (node.specifiers.length === 0) {\n context.report({\n node,\n messageId: 'defaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n if (node.specifiers.length > 1) {\n context.report({\n node,\n messageId: 'onlyDefaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n const defaultImportSpecifier = node.specifiers.find(\n (specifier) => specifier.type === 'ImportDefaultSpecifier',\n );\n\n if (defaultImportSpecifier == null) {\n context.report({\n node,\n messageId: 'onlyDefaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n const dirname = path.dirname(context.physicalFilename);\n const absoluteImportPath = path.resolve(dirname, importPath);\n\n if (!fs.existsSync(absoluteImportPath)) {\n context.report({\n node,\n messageId: 'fileDoesNotExist',\n data: { absoluteImportPath },\n });\n\n return;\n }\n\n const importName = defaultImportSpecifier.local.name;\n\n classNames[importName] = new Set();\n\n const cssModuleContent = fs.readFileSync(absoluteImportPath, 'utf8');\n const root = parse(cssModuleContent);\n\n for (const node of root.nodes) {\n if (node.type === 'rule') {\n selectorParser(function transform(selectors) {\n selectors.walkClasses((classNode) => {\n classNames[importName].add(classNode.value);\n });\n }).processSync(node.selector);\n } else if (\n node.type === 'atrule' &&\n (node.name === 'media' ||\n node.name === 'container' ||\n node.name === 'layer')\n ) {\n for (const childNode of node.nodes) {\n if (childNode.type !== 'rule') {\n continue;\n }\n\n selectorParser(function transform(selectors) {\n selectors.walkClasses((classNode) => {\n classNames[importName].add(classNode.value);\n });\n }).processSync(childNode.selector);\n }\n }\n }\n },\n MemberExpression(node) {\n if (node.object.type !== 'Identifier') {\n return;\n }\n\n if (classNames[node.object.name] == null) {\n return;\n }\n\n const objectName = node.object.name;\n\n if (node.property.type === 'Identifier') {\n const className = node.property.name;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n\n return;\n }\n\n if (\n node.property.type === 'Literal' &&\n typeof node.property.value === 'string'\n ) {\n const className = node.property.value;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n }\n },\n VariableDeclarator(node) {\n if (node.id.type !== 'ObjectPattern') {\n return;\n }\n\n if (node.init?.type !== 'Identifier') {\n return;\n }\n\n const objectName = node.init.name;\n\n if (classNames[objectName] == null) {\n return;\n }\n\n for (const property of node.id.properties) {\n if (property.type !== 'Property') {\n continue;\n }\n\n if (property.key.type !== 'Identifier') {\n continue;\n }\n\n const className = property.key.name;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node: property,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n }\n },\n };\n },\n};\n\nexport default cssModuleClassExistsRule;\n","import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst noLegacyNodeImportRule: RuleModule<'invalidImport'> = {\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'enforce importing node standard library modules using `node:` prefix',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebno-legacy-node-import',\n },\n schema: [],\n messages: {\n invalidImport:\n 'Node standard library modules must be imported using the \"node:\" prefix',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !NODE_STANDARD_MODULES.includes(node.source.value)\n ) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidImport',\n fix(fixer) {\n if (typeof node.source.value !== 'string') {\n return null;\n }\n\n const newImportPath = `node:${node.source.value}`;\n const quote = node.source.raw[0]; // preserve original quote style\n\n return fixer.replaceText(\n node.source,\n `${quote}${newImportPath}${quote}`,\n );\n },\n });\n },\n };\n },\n};\n\nexport default noLegacyNodeImportRule;\n\nexport const NODE_STANDARD_MODULES = Object.freeze([\n 'assert',\n 'assert/strict',\n 'async_hooks',\n 'buffer',\n 'child_process',\n 'cluster',\n 'console',\n 'crypto',\n 'dns',\n 'dns/promises',\n 'domain',\n 'events',\n 'fs',\n 'fs/promises',\n 'http',\n 'http2',\n 'https',\n 'inspector',\n 'module',\n 'net',\n 'os',\n 'path',\n 'perf_hooks',\n 'process',\n 'punycode',\n 'querystring',\n 'readline',\n 'readline/promises',\n 'repl',\n 'sqlite',\n 'stream',\n 'stream/promises',\n 'string_decoder',\n 'test',\n 'timers',\n 'timers/promises',\n 'tls',\n 'trace_events',\n 'tty',\n 'url',\n 'util',\n 'util/types',\n 'v8',\n 'vm',\n 'wasi',\n 'worker_threads',\n 'zlib',\n]);\n","import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\nimport type {\n ArrowFunctionExpression,\n FunctionDeclaration,\n VariableDeclarator,\n} from 'estree';\n\nconst reactNamedFuncComponentsRule: RuleModule<'invalidComponentDefinition'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce use of named functions when defining React components',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebreact-named-func-components',\n },\n schema: [],\n messages: {\n invalidComponentDefinition:\n 'React components must be defined using named functions',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n VariableDeclarator(node) {\n if (!isReactComponent(node as VariableDeclarator)) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidComponentDefinition',\n });\n },\n };\n },\n};\n\nexport default reactNamedFuncComponentsRule;\n\nfunction isReactComponent(\n node: FunctionDeclaration | ArrowFunctionExpression | VariableDeclarator,\n) {\n if (node.type === 'VariableDeclarator') {\n if (node.init == null) {\n return false;\n }\n\n if (node.init.type !== 'ArrowFunctionExpression') {\n return false;\n }\n\n if (node.id.type !== 'Identifier' || !/^[A-Z]/.test(node.id.name)) {\n return false;\n }\n\n return isReactComponent(node.init);\n } else if (node.type === 'FunctionDeclaration') {\n if (node.id != null && !/^[A-Z]/.test(node.id.name)) {\n return false;\n }\n }\n\n if (node.body.type === 'BlockStatement') {\n for (const statement of node.body.body) {\n if (\n statement.type === 'ReturnStatement' &&\n statement.argument != null &&\n // @ts-expect-error: ESTree types are missing JSXElement\n (statement.argument.type === 'JSXElement' ||\n // @ts-expect-error: ESTree types are missing JSXFragment\n statement.argument.type === 'JSXFragment' ||\n (statement.argument.type === 'Literal' &&\n statement.argument.value === null))\n ) {\n return true;\n }\n }\n // @ts-expect-error: ESTree types are missing JSXElement\n } else if (node.body.type === 'JSXElement') {\n return true;\n } else if (\n // @ts-expect-error: ESTree types are missing ParenthesizedExpression\n node.body.type === 'ParenthesizedExpression' &&\n // @ts-expect-error: ESTree types are missing JSXElement\n node.body.expression?.type === 'JSXElement'\n ) {\n return true;\n }\n\n return false;\n}\n","import path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst validServerActionsPathRule: RuleModule<'invalidPath'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce server actions are exported from file paths that match \"app/**/_actions.ts\" or \"app/**/_actions/**/*.ts\"',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebvalid-server-actions-path',\n },\n schema: [],\n messages: {\n invalidPath:\n 'Server action files must be located in a directory named \"_actions\" or have the filename \"_actions.ts\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ExpressionStatement(node) {\n if (\n node.expression.type !== 'Literal' ||\n node.expression.value !== 'use server'\n ) {\n return;\n }\n\n const basename = path.basename(context.filename);\n const dirname = path.dirname(context.filename);\n\n // Escape backslashes for RegExp (Windows paths)\n const escapedSep = path.sep.replace('\\\\', '\\\\\\\\');\n\n const isInActionsDir = new RegExp(\n `app(${escapedSep}.*)?${escapedSep}_actions`,\n ).test(dirname);\n\n const isActionsFile =\n (dirname === 'app' || new RegExp(`app${escapedSep}`).test(dirname)) &&\n /_actions\\.(js|ts)$/.test(basename);\n\n if (!isInActionsDir && !isActionsFile) {\n context.report({\n node,\n messageId: 'invalidPath',\n });\n }\n },\n };\n },\n};\n\nexport default validServerActionsPathRule;\n","import packageJson from '../package.json' with { type: 'json' };\n\nimport banLodashImport from './rules/ban-lodash-import.ts';\nimport cssModuleNameMatchesRule from './rules/css-module-name-matches.ts';\nimport cssModuleClassExistsRule from './rules/css-module-class-exists.ts';\nimport noLegacyNodeImport from './rules/no-legacy-node-import.ts';\nimport reactNamedFuncComponents from './rules/react-named-func-components.ts';\nimport validServerActionsPathRule from './rules/valid-server-actions-path.ts';\n\nconst plugin = {\n meta: {\n name: packageJson.name,\n version: packageJson.version,\n },\n configs: {},\n rules: {\n 'ban-lodash-import': banLodashImport,\n 'css-module-name-matches': cssModuleNameMatchesRule,\n 'css-module-class-exists': cssModuleClassExistsRule,\n 'no-legacy-node-import': noLegacyNodeImport,\n 'react-named-func-components': reactNamedFuncComponents,\n 'valid-server-actions-path': validServerActionsPathRule,\n },\n};\n\nconst RULE_NAMES = Object.keys(plugin.rules).map(\n (ruleName) => `friendsoftheweb/${ruleName}`,\n);\n\n/**\n * @param {'error' | 'warn'} reportLevel\n */\nfunction buildConfig(reportLevel) {\n return {\n plugins: {\n friendsoftheweb: plugin,\n },\n rules: Object.fromEntries(\n RULE_NAMES.map((ruleName) => [ruleName, reportLevel]),\n ),\n };\n}\n\nconst errorConfig = buildConfig('error');\nconst warnConfig = buildConfig('warn');\n\nconst futureConfig = {\n ...errorConfig,\n rules: {\n ...errorConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'warn',\n },\n};\n\nconst recommendedConfig = {\n ...errorConfig,\n rules: {\n ...errorConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'off',\n },\n};\n\nconst migrateConfig = {\n ...warnConfig,\n rules: {\n ...warnConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'off',\n },\n};\n\nObject.assign(plugin.configs, {\n 'flat/future': [futureConfig],\n 'flat/recommended': [recommendedConfig],\n 'flat/migrate': [migrateConfig],\n future: futureConfig,\n recommended: recommendedConfig,\n migrate: migrateConfig,\n});\n\nexport default plugin;\n"],"names":["banLodashImport","noLegacyNodeImport","reactNamedFuncComponents"],"mappings":";;;;;;;;;;;AAEA,MAAM,mBAAmB,GAAgC;AACvD,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,IAAI,EAAE;AACJ,YAAA,WAAW,EACT,kEAAkE;AACpE,YAAA,GAAG,EAAE,mFAAmF;AACzF,SAAA;AACD,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,QAAQ,EAAE;AACR,YAAA,aAAa,EACX,iEAAiE;AACpE,SAAA;AACF,KAAA;AACD,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,MAAM,CAAC,OAAO,EAAA;QACZ,OAAO;AACL,YAAA,iBAAiB,CAAC,IAAI,EAAA;AACpB,gBAAA,IACE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ;AACrC,qBAAC,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ;AAC7B,wBAAA,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CA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AM,CAAC;AAEtC,MAAM,YAAY,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACb,WAAW,CAAA,EAAA,EACd,KAAK,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACA,WAAW,CAAC,KAAK,CAAA,EAAA,EACpB,6CAA6C,EAAE,MAAM,MAExD;AAED,MAAM,iBAAiB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAClB,WAAW,CAAA,EAAA,EACd,KAAK,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACA,WAAW,CAAC,KAAK,CAAA,EAAA,EACpB,6CAA6C,EAAE,KAAK,MAEvD;AAED,MAAM,aAAa,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACd,UAAU,CAAA,EAAA,EACb,KAAK,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACA,UAAU,CAAC,KAAK,CAAA,EAAA,EACnB,6CAA6C,EAAE,KAAK,MAEvD;AAED,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;IAC5B,aAAa,EAAE,CAAC,YAAY,CAAC;IAC7B,kBAAkB,EAAE,CAAC,iBAAiB,CAAC;IACvC,cAAc,EAAE,CAAC,aAAa,CAAC;AAC/B,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,WAAW,EAAE,iBAAiB;AAC9B,IAAA,OAAO,EAAE,aAAa;AACvB,CAAA,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/rules/ban-lodash-import.ts","../../../../src/rules/css-module-class-exists.ts","../../../../src/rules/css-module-name-matches.ts","../../../../src/rules/import-from-utils.ts","../../../../src/rules/no-legacy-node-import.ts","../../../../src/rules/react-named-func-components.ts","../../../../src/rules/valid-server-actions-path.ts","../../../../src/index.ts"],"sourcesContent":["import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst banLodashImportRule: RuleModule<'invalidImport'> = {\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'enforce importing functions from `lodash-es` instead of `lodash`',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebban-lodash-import',\n },\n schema: [],\n messages: {\n invalidImport:\n 'Functions must be imported from \"lodash-es\" instead of \"lodash\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n (node.source.value !== 'lodash' &&\n !node.source.value.startsWith('lodash/'))\n ) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidImport',\n fix(fixer) {\n if (typeof node.source.value !== 'string') {\n return null;\n }\n\n if (node.source.value === 'lodash/fp') {\n return null; // no automatic fix for fp imports\n }\n\n const newImportPath =\n node.source.value === 'lodash'\n ? 'lodash-es'\n : node.source.value.replace(/^lodash\\//, 'lodash-es/');\n\n const quote = node.source.raw[0]; // preserve original quote style\n\n return fixer.replaceText(\n node.source,\n `${quote}${newImportPath}${quote}`,\n );\n },\n });\n },\n };\n },\n};\n\nexport default banLodashImportRule;\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\nimport { parse } from 'postcss';\nimport selectorParser from 'postcss-selector-parser';\n\nconst cssModuleClassExistsRule: RuleModule<\n | 'relativePath'\n | 'defaultImport'\n | 'onlyDefaultImport'\n | 'fileDoesNotExist'\n | 'classDoesNotExist'\n> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce that class names used from an imported CSS module exist in the module file',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-class-exists',\n },\n schema: [],\n messages: {\n relativePath:\n 'CSS module import \"{{importPath}}\" should be a relative path',\n defaultImport:\n 'CSS module import \"{{importPath}}\" should have a default import',\n onlyDefaultImport:\n 'CSS module import \"{{importPath}}\" should have only a default import',\n fileDoesNotExist:\n 'CSS module file \"{{absoluteImportPath}}\" does not exist',\n classDoesNotExist:\n 'Class `.{{className}}` does not exist in the CSS module imported as `{{objectName}}`',\n },\n },\n defaultOptions: [],\n create(context) {\n const classNames = {};\n\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !node.source.value.endsWith('.module.css')\n ) {\n return;\n }\n\n const importPath = node.source.value;\n\n if (!(importPath.startsWith('./') || importPath.startsWith('../'))) {\n context.report({\n node,\n messageId: 'relativePath',\n data: { importPath },\n });\n\n return;\n }\n\n if (node.specifiers.length === 0) {\n context.report({\n node,\n messageId: 'defaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n if (node.specifiers.length > 1) {\n context.report({\n node,\n messageId: 'onlyDefaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n const defaultImportSpecifier = node.specifiers.find(\n (specifier) => specifier.type === 'ImportDefaultSpecifier',\n );\n\n if (defaultImportSpecifier == null) {\n context.report({\n node,\n messageId: 'onlyDefaultImport',\n data: { importPath },\n });\n\n return;\n }\n\n const dirname = path.dirname(context.physicalFilename);\n const absoluteImportPath = path.resolve(dirname, importPath);\n\n if (!fs.existsSync(absoluteImportPath)) {\n context.report({\n node,\n messageId: 'fileDoesNotExist',\n data: { absoluteImportPath },\n });\n\n return;\n }\n\n const importName = defaultImportSpecifier.local.name;\n\n classNames[importName] = new Set();\n\n const cssModuleContent = fs.readFileSync(absoluteImportPath, 'utf8');\n const root = parse(cssModuleContent);\n\n for (const node of root.nodes) {\n if (node.type === 'rule') {\n selectorParser(function transform(selectors) {\n selectors.walkClasses((classNode) => {\n classNames[importName].add(classNode.value);\n });\n }).processSync(node.selector);\n } else if (\n node.type === 'atrule' &&\n (node.name === 'media' ||\n node.name === 'container' ||\n node.name === 'layer')\n ) {\n for (const childNode of node.nodes) {\n if (childNode.type !== 'rule') {\n continue;\n }\n\n selectorParser(function transform(selectors) {\n selectors.walkClasses((classNode) => {\n classNames[importName].add(classNode.value);\n });\n }).processSync(childNode.selector);\n }\n }\n }\n },\n MemberExpression(node) {\n if (node.object.type !== 'Identifier') {\n return;\n }\n\n if (classNames[node.object.name] == null) {\n return;\n }\n\n const objectName = node.object.name;\n\n if (node.property.type === 'Identifier') {\n const className = node.property.name;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n\n return;\n }\n\n if (\n node.property.type === 'Literal' &&\n typeof node.property.value === 'string'\n ) {\n const className = node.property.value;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n }\n },\n VariableDeclarator(node) {\n if (node.id.type !== 'ObjectPattern') {\n return;\n }\n\n if (node.init?.type !== 'Identifier') {\n return;\n }\n\n const objectName = node.init.name;\n\n if (classNames[objectName] == null) {\n return;\n }\n\n for (const property of node.id.properties) {\n if (property.type !== 'Property') {\n continue;\n }\n\n if (property.key.type !== 'Identifier') {\n continue;\n }\n\n const className = property.key.name;\n\n if (!classNames[objectName].has(className)) {\n context.report({\n node: property,\n messageId: 'classDoesNotExist',\n data: { className, objectName },\n });\n }\n }\n },\n };\n },\n};\n\nexport default cssModuleClassExistsRule;\n","import path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst cssModuleNameMatchesRule: RuleModule<'filenameMismatch'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n \"enforce that a CSS module's filename matches the filename of the importing file\",\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebcss-module-name-matches',\n },\n schema: [],\n messages: {\n filenameMismatch:\n 'CSS module filename \"{{cssModuleFilename}}\" does not match the current filename \"{{filename}}\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !node.source.value.endsWith('.module.css')\n ) {\n return;\n }\n\n const filename = path.basename(\n context.filename,\n path.extname(context.filename),\n );\n\n const cssModulePath = node.source.value;\n const cssModuleFilename = path.basename(cssModulePath, '.module.css');\n\n if (cssModuleFilename !== filename) {\n context.report({\n node,\n messageId: 'filenameMismatch',\n data: {\n cssModuleFilename,\n filename,\n },\n });\n }\n },\n };\n },\n};\n\nexport default cssModuleNameMatchesRule;\n","import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nexport const functionNames = [\n 'buildContentDispositionHeader',\n 'createCSVStream',\n 'deepCamelCaseKeys',\n 'deepPascalCaseKeys',\n 'deepSnakeCaseKeys',\n 'deepTransformKeys',\n 'formatDateForDateInput',\n 'formatDateForDateTimeInput',\n 'formatDuration',\n 'formatFileSize',\n 'isPresent',\n 'isPresentNumber',\n 'isPresentString',\n 'parseNullableDate',\n 'parseNullableFloat',\n 'parseNullableInt',\n 'presence',\n 'slugify',\n];\n\nconst importFromUtils: RuleModule<'invalidImport'> = {\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'enforce importing util functions from `@friendsoftheweb/utils`',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebimport-from-utils',\n },\n schema: [],\n messages: {\n invalidImport:\n '{{functionNames}} must be imported from \"@friendsoftheweb/utils\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (node.importKind === 'type') {\n return;\n }\n\n if (\n typeof node.source.value !== 'string' ||\n node.source.value === '@friendsoftheweb/utils'\n ) {\n return;\n }\n\n const foundFunctionNames: string[] = [];\n\n for (const specifier of node.specifiers) {\n if (\n specifier.type === 'ImportSpecifier' &&\n specifier.importKind !== 'type' &&\n specifier.imported.type === 'Identifier' &&\n functionNames.includes(specifier.imported.name)\n ) {\n foundFunctionNames.push(specifier.imported.name);\n }\n }\n\n if (foundFunctionNames.length === 0) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidImport',\n data: {\n functionNames: foundFunctionNames\n .map((name) => `\"${name}\"`)\n .join(', '),\n },\n fix(fixer) {\n if (typeof node.source.value !== 'string') {\n return null;\n }\n\n if (foundFunctionNames.length < node.specifiers.length) {\n // Don't auto-fix if there are other imports that would be affected\n return null;\n }\n\n const newImportPath = '@friendsoftheweb/utils';\n const quote = node.source.raw[0]; // preserve original quote style\n\n return fixer.replaceText(\n node.source,\n `${quote}${newImportPath}${quote}`,\n );\n },\n });\n },\n };\n },\n};\n\nexport default importFromUtils;\n","import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst noLegacyNodeImportRule: RuleModule<'invalidImport'> = {\n meta: {\n type: 'problem',\n fixable: 'code',\n docs: {\n description:\n 'enforce importing node standard library modules using `node:` prefix',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebno-legacy-node-import',\n },\n schema: [],\n messages: {\n invalidImport:\n 'Node standard library modules must be imported using the \"node:\" prefix',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ImportDeclaration(node) {\n if (\n typeof node.source.value !== 'string' ||\n !NODE_STANDARD_MODULES.includes(node.source.value)\n ) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidImport',\n fix(fixer) {\n if (typeof node.source.value !== 'string') {\n return null;\n }\n\n const newImportPath = `node:${node.source.value}`;\n const quote = node.source.raw[0]; // preserve original quote style\n\n return fixer.replaceText(\n node.source,\n `${quote}${newImportPath}${quote}`,\n );\n },\n });\n },\n };\n },\n};\n\nexport default noLegacyNodeImportRule;\n\nexport const NODE_STANDARD_MODULES = Object.freeze([\n 'assert',\n 'assert/strict',\n 'async_hooks',\n 'buffer',\n 'child_process',\n 'cluster',\n 'console',\n 'crypto',\n 'dns',\n 'dns/promises',\n 'domain',\n 'events',\n 'fs',\n 'fs/promises',\n 'http',\n 'http2',\n 'https',\n 'inspector',\n 'module',\n 'net',\n 'os',\n 'path',\n 'perf_hooks',\n 'process',\n 'punycode',\n 'querystring',\n 'readline',\n 'readline/promises',\n 'repl',\n 'sqlite',\n 'stream',\n 'stream/promises',\n 'string_decoder',\n 'test',\n 'timers',\n 'timers/promises',\n 'tls',\n 'trace_events',\n 'tty',\n 'url',\n 'util',\n 'util/types',\n 'v8',\n 'vm',\n 'wasi',\n 'worker_threads',\n 'zlib',\n]);\n","import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\nimport type {\n ArrowFunctionExpression,\n FunctionDeclaration,\n VariableDeclarator,\n} from 'estree';\n\nconst reactNamedFuncComponentsRule: RuleModule<'invalidComponentDefinition'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce use of named functions when defining React components',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebreact-named-func-components',\n },\n schema: [],\n messages: {\n invalidComponentDefinition:\n 'React components must be defined using named functions',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n VariableDeclarator(node) {\n if (!isReactComponent(node as VariableDeclarator)) {\n return;\n }\n\n context.report({\n node,\n messageId: 'invalidComponentDefinition',\n });\n },\n };\n },\n};\n\nexport default reactNamedFuncComponentsRule;\n\nfunction isReactComponent(\n node: FunctionDeclaration | ArrowFunctionExpression | VariableDeclarator,\n) {\n if (node.type === 'VariableDeclarator') {\n if (node.init == null) {\n return false;\n }\n\n if (node.init.type !== 'ArrowFunctionExpression') {\n return false;\n }\n\n if (node.id.type !== 'Identifier' || !/^[A-Z]/.test(node.id.name)) {\n return false;\n }\n\n return isReactComponent(node.init);\n } else if (node.type === 'FunctionDeclaration') {\n if (node.id != null && !/^[A-Z]/.test(node.id.name)) {\n return false;\n }\n }\n\n if (node.body.type === 'BlockStatement') {\n for (const statement of node.body.body) {\n if (\n statement.type === 'ReturnStatement' &&\n statement.argument != null &&\n // @ts-expect-error: ESTree types are missing JSXElement\n (statement.argument.type === 'JSXElement' ||\n // @ts-expect-error: ESTree types are missing JSXFragment\n statement.argument.type === 'JSXFragment' ||\n (statement.argument.type === 'Literal' &&\n statement.argument.value === null))\n ) {\n return true;\n }\n }\n // @ts-expect-error: ESTree types are missing JSXElement\n } else if (node.body.type === 'JSXElement') {\n return true;\n } else if (\n // @ts-expect-error: ESTree types are missing ParenthesizedExpression\n node.body.type === 'ParenthesizedExpression' &&\n // @ts-expect-error: ESTree types are missing JSXElement\n node.body.expression?.type === 'JSXElement'\n ) {\n return true;\n }\n\n return false;\n}\n","import path from 'node:path';\n\nimport type { RuleModule } from '@typescript-eslint/utils/ts-eslint';\n\nconst validServerActionsPathRule: RuleModule<'invalidPath'> = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'enforce server actions are exported from file paths that match \"app/**/_actions.ts\" or \"app/**/_actions/**/*.ts\"',\n url: 'https://github.com/friendsoftheweb/eslint-plugin#friendsofthewebvalid-server-actions-path',\n },\n schema: [],\n messages: {\n invalidPath:\n 'Server action files must be located in a directory named \"_actions\" or have the filename \"_actions.ts\"',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n ExpressionStatement(node) {\n if (\n node.expression.type !== 'Literal' ||\n node.expression.value !== 'use server'\n ) {\n return;\n }\n\n const basename = path.basename(context.filename);\n const dirname = path.dirname(context.filename);\n\n // Escape backslashes for RegExp (Windows paths)\n const escapedSep = path.sep.replace('\\\\', '\\\\\\\\');\n\n const isInActionsDir = new RegExp(\n `app(${escapedSep}.*)?${escapedSep}_actions`,\n ).test(dirname);\n\n const isActionsFile =\n (dirname === 'app' || new RegExp(`app${escapedSep}`).test(dirname)) &&\n /_actions\\.(js|ts)$/.test(basename);\n\n if (!isInActionsDir && !isActionsFile) {\n context.report({\n node,\n messageId: 'invalidPath',\n });\n }\n },\n };\n },\n};\n\nexport default validServerActionsPathRule;\n","import packageJson from '../package.json' with { type: 'json' };\n\nimport banLodashImport from './rules/ban-lodash-import.ts';\nimport cssModuleClassExistsRule from './rules/css-module-class-exists.ts';\nimport cssModuleNameMatchesRule from './rules/css-module-name-matches.ts';\nimport importFromUtils from './rules/import-from-utils.ts';\nimport noLegacyNodeImport from './rules/no-legacy-node-import.ts';\nimport reactNamedFuncComponents from './rules/react-named-func-components.ts';\nimport validServerActionsPathRule from './rules/valid-server-actions-path.ts';\n\nconst plugin = {\n meta: {\n name: packageJson.name,\n version: packageJson.version,\n },\n configs: {},\n rules: {\n 'ban-lodash-import': banLodashImport,\n 'css-module-name-matches': cssModuleNameMatchesRule,\n 'css-module-class-exists': cssModuleClassExistsRule,\n 'import-from-utils': importFromUtils,\n 'no-legacy-node-import': noLegacyNodeImport,\n 'react-named-func-components': reactNamedFuncComponents,\n 'valid-server-actions-path': validServerActionsPathRule,\n },\n};\n\nconst RULE_NAMES = Object.keys(plugin.rules).map(\n (ruleName) => `friendsoftheweb/${ruleName}`,\n);\n\n/**\n * @param {'error' | 'warn'} reportLevel\n */\nfunction buildConfig(reportLevel) {\n return {\n plugins: {\n friendsoftheweb: plugin,\n },\n rules: Object.fromEntries(\n RULE_NAMES.map((ruleName) => [ruleName, reportLevel]),\n ),\n };\n}\n\nconst errorConfig = buildConfig('error');\nconst warnConfig = buildConfig('warn');\n\nconst futureConfig = {\n ...errorConfig,\n rules: {\n ...errorConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'warn',\n },\n};\n\nconst recommendedConfig = {\n ...errorConfig,\n rules: {\n ...errorConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'off',\n },\n};\n\nconst migrateConfig = {\n ...warnConfig,\n rules: {\n ...warnConfig.rules,\n 'friendsoftheweb/react-named-func-components': 'off',\n },\n};\n\nObject.assign(plugin.configs, {\n 'flat/future': [futureConfig],\n 'flat/recommended': [recommendedConfig],\n 'flat/migrate': [migrateConfig],\n future: futureConfig,\n recommended: recommendedConfig,\n migrate: migrateConfig,\n});\n\nexport default plugin;\n"],"names":["banLodashImport","noLegacyNodeImport","reactNamedFuncComponents"],"mappings":";;;;;;;;;;;AAEA,MAAM,mBAAmB,GAAgC;AACvD,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,IAAI,EAAE;AACJ,YAAA,WAAW,EACT,kEAAkE;AACpE,YAAA,GAAG,EAAE,m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/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare const plugin: {
|
|
|
8
8
|
'ban-lodash-import': import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidImport", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
9
9
|
'css-module-name-matches': import("@typescript-eslint/utils/ts-eslint").RuleModule<"filenameMismatch", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
10
10
|
'css-module-class-exists': import("@typescript-eslint/utils/ts-eslint").RuleModule<"relativePath" | "defaultImport" | "onlyDefaultImport" | "fileDoesNotExist" | "classDoesNotExist", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
11
|
+
'import-from-utils': import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidImport", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
11
12
|
'no-legacy-node-import': import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidImport", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
12
13
|
'react-named-func-components': import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidComponentDefinition", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
13
14
|
'valid-server-actions-path': import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidPath", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|