@friendsoftheweb/eslint-plugin 0.0.3-beta.5 → 0.0.3

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 CHANGED
@@ -6,7 +6,7 @@ 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.3-beta.5";
9
+ var version = "0.0.3";
10
10
  var packageJson = {
11
11
  name: name,
12
12
  version: version};
@@ -370,6 +370,7 @@ const reactNamedFuncComponentsRule = {
370
370
  },
371
371
  };
372
372
  function isReactComponent(node) {
373
+ var _a;
373
374
  if (node.type === 'VariableDeclarator') {
374
375
  if (node.init == null) {
375
376
  return false;
@@ -387,18 +388,30 @@ function isReactComponent(node) {
387
388
  return false;
388
389
  }
389
390
  }
390
- if (node.body.type !== 'BlockStatement') {
391
- return false;
392
- }
393
- for (const statement of node.body.body) {
394
- if (statement.type === 'ReturnStatement' &&
395
- statement.argument != null &&
396
- // @ts-expect-error: ESTree types are missing JSXElement
397
- (statement.argument.type === 'JSXElement' ||
398
- (statement.argument.type === 'Literal' &&
399
- statement.argument.value === null))) {
400
- return true;
391
+ if (node.body.type === 'BlockStatement') {
392
+ for (const statement of node.body.body) {
393
+ if (statement.type === 'ReturnStatement' &&
394
+ statement.argument != null &&
395
+ // @ts-expect-error: ESTree types are missing JSXElement
396
+ (statement.argument.type === 'JSXElement' ||
397
+ // @ts-expect-error: ESTree types are missing JSXFragment
398
+ statement.argument.type === 'JSXFragment' ||
399
+ (statement.argument.type === 'Literal' &&
400
+ statement.argument.value === null))) {
401
+ return true;
402
+ }
401
403
  }
404
+ // @ts-expect-error: ESTree types are missing JSXElement
405
+ }
406
+ else if (node.body.type === 'JSXElement') {
407
+ return true;
408
+ }
409
+ else if (
410
+ // @ts-expect-error: ESTree types are missing ParenthesizedExpression
411
+ node.body.type === 'ParenthesizedExpression' &&
412
+ // @ts-expect-error: ESTree types are missing JSXElement
413
+ ((_a = node.body.expression) === null || _a === void 0 ? void 0 : _a.type) === 'JSXElement') {
414
+ return true;
402
415
  }
403
416
  return false;
404
417
  }
@@ -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 return false;\n }\n\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 (statement.argument.type === 'Literal' &&\n statement.argument.value === null))\n ) {\n return true;\n }\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,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,GAAG,WAAW,CAAC,MAAM,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-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,iEAAi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AC/B,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,WAAW,EAAE,iBAAiB;AAC9B,IAAA,OAAO,EAAE,aAAa;AACvB,CAAA,CAAC;;;;"}
package/dist/esm/index.js CHANGED
@@ -4,7 +4,7 @@ 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.3-beta.5";
7
+ var version = "0.0.3";
8
8
  var packageJson = {
9
9
  name: name,
10
10
  version: version};
@@ -368,6 +368,7 @@ const reactNamedFuncComponentsRule = {
368
368
  },
369
369
  };
370
370
  function isReactComponent(node) {
371
+ var _a;
371
372
  if (node.type === 'VariableDeclarator') {
372
373
  if (node.init == null) {
373
374
  return false;
@@ -385,18 +386,30 @@ function isReactComponent(node) {
385
386
  return false;
386
387
  }
387
388
  }
388
- if (node.body.type !== 'BlockStatement') {
389
- return false;
390
- }
391
- for (const statement of node.body.body) {
392
- if (statement.type === 'ReturnStatement' &&
393
- statement.argument != null &&
394
- // @ts-expect-error: ESTree types are missing JSXElement
395
- (statement.argument.type === 'JSXElement' ||
396
- (statement.argument.type === 'Literal' &&
397
- statement.argument.value === null))) {
398
- return true;
389
+ if (node.body.type === 'BlockStatement') {
390
+ for (const statement of node.body.body) {
391
+ if (statement.type === 'ReturnStatement' &&
392
+ statement.argument != null &&
393
+ // @ts-expect-error: ESTree types are missing JSXElement
394
+ (statement.argument.type === 'JSXElement' ||
395
+ // @ts-expect-error: ESTree types are missing JSXFragment
396
+ statement.argument.type === 'JSXFragment' ||
397
+ (statement.argument.type === 'Literal' &&
398
+ statement.argument.value === null))) {
399
+ return true;
400
+ }
399
401
  }
402
+ // @ts-expect-error: ESTree types are missing JSXElement
403
+ }
404
+ else if (node.body.type === 'JSXElement') {
405
+ return true;
406
+ }
407
+ else if (
408
+ // @ts-expect-error: ESTree types are missing ParenthesizedExpression
409
+ node.body.type === 'ParenthesizedExpression' &&
410
+ // @ts-expect-error: ESTree types are missing JSXElement
411
+ ((_a = node.body.expression) === null || _a === void 0 ? void 0 : _a.type) === 'JSXElement') {
412
+ return true;
400
413
  }
401
414
  return false;
402
415
  }
@@ -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 return false;\n }\n\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 (statement.argument.type === 'Literal' &&\n statement.argument.value === null))\n ) {\n return true;\n }\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,EA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AC,MAAM,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-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,KA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,YAAY;AACpB,IAAA,WAAW,EAAE,iBAAiB;AAC9B,IAAA,OAAO,EAAE,aAAa;AACvB,CAAA,CAAC;;;;"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "repository": {
4
4
  "url": "git+https://github.com/friendsoftheweb/eslint-plugin.git"
5
5
  },
6
- "version": "0.0.3-beta.5",
6
+ "version": "0.0.3",
7
7
  "type": "module",
8
8
  "license": "MIT",
9
9
  "packageManager": "yarn@4.12.0",
@@ -25,7 +25,9 @@
25
25
  "types:check": "tsc --noEmit",
26
26
  "lint": "eslint",
27
27
  "format:check": "prettier --check .",
28
- "build": "rm -rf dist && rollup --config rollup.config.mjs && tsc -p tsconfig.build.json"
28
+ "build": "rm -rf dist && rollup --config rollup.config.mjs && tsc -p tsconfig.build.json",
29
+ "publish": "npm publish --access public",
30
+ "publish:next": "npm publish --access public --tag next"
29
31
  },
30
32
  "devDependencies": {
31
33
  "@eslint/js": "^9.39.2",
@@ -42,6 +44,7 @@
42
44
  "rollup": "^4.55.1",
43
45
  "sinon": "^21.0.1",
44
46
  "tslib": "^2.8.1",
47
+ "turbo": "^2.7.3",
45
48
  "typescript": "^5.9.3"
46
49
  },
47
50
  "dependencies": {