eslint-plugin-nextfriday 1.0.1 → 1.0.2
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/CHANGELOG.md +6 -0
- package/lib/index.cjs +14 -4
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +14 -4
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# eslint-plugin-nextfriday
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#9](https://github.com/next-friday/eslint-plugin-nextfriday/pull/9) [`11066f0`](https://github.com/next-friday/eslint-plugin-nextfriday/commit/11066f030e8b510e415e9d5eb8fb95d1d2200354) Thanks [@nextfridaydeveloper](https://github.com/nextfridaydeveloper)! - Fix workflow fetch bug in release.yml
|
|
8
|
+
|
|
3
9
|
## 1.0.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/lib/index.cjs
CHANGED
|
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
40
40
|
// package.json
|
|
41
41
|
var package_default = {
|
|
42
42
|
name: "eslint-plugin-nextfriday",
|
|
43
|
-
version: "1.0.
|
|
43
|
+
version: "1.0.2",
|
|
44
44
|
description: "A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.",
|
|
45
45
|
keywords: [
|
|
46
46
|
"eslint",
|
|
@@ -440,6 +440,14 @@ var preferImportType = createRule7({
|
|
|
440
440
|
if (context.filename.includes(".test.") || context.filename.includes(".spec.") || context.filename.includes("__tests__")) {
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
443
|
+
if (node.specifiers.length === 0) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
const source = node.source.value;
|
|
447
|
+
const isRuntimeImport = /\.(css|scss|sass|less|styl)(\?.*)?$/.test(source) || /\.(png|jpg|jpeg|gif|svg|webp|ico|bmp)(\?.*)?$/.test(source) || /\.(woff|woff2|ttf|eot|otf)(\?.*)?$/.test(source) || /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/.test(source) || /\.(json|txt|md|xml|yml|yaml)(\?.*)?$/.test(source) || /^next\/(font|image|link|head|script|dynamic|router)/.test(source) || source.includes("/font/") || source === "react-dom" || source === "react-dom/client" || source === "react-dom/server" || source.startsWith("@emotion/") || source.startsWith("styled-components") || source.includes("polyfill") || source.includes("shim") || source === "styled-jsx/css" || source.startsWith("webpack/");
|
|
448
|
+
if (isRuntimeImport) {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
443
451
|
const isTypeOnlyImport = node.specifiers.every((specifier) => {
|
|
444
452
|
if (specifier.type === import_utils7.AST_NODE_TYPES.ImportDefaultSpecifier) {
|
|
445
453
|
return false;
|
|
@@ -449,7 +457,9 @@ var preferImportType = createRule7({
|
|
|
449
457
|
}
|
|
450
458
|
if (specifier.type === import_utils7.AST_NODE_TYPES.ImportSpecifier) {
|
|
451
459
|
const importedName = specifier.imported.type === import_utils7.AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value;
|
|
452
|
-
const isKnownTypeOnly = node.source.value === "@typescript-eslint/utils" && ["TSESTree", "RuleContext"].includes(importedName) || node.source.value === "react" && ["Component", "ComponentProps", "ReactNode", "FC", "JSX"
|
|
460
|
+
const isKnownTypeOnly = node.source.value === "@typescript-eslint/utils" && ["TSESTree", "RuleContext"].includes(importedName) || node.source.value === "react" && ["Component", "ComponentProps", "ReactNode", "FC", "JSX", "ReactElement", "PropsWithChildren"].includes(
|
|
461
|
+
importedName
|
|
462
|
+
) || importedName.endsWith("Type") || importedName.endsWith("Interface") || importedName.endsWith("Props");
|
|
453
463
|
return isKnownTypeOnly;
|
|
454
464
|
}
|
|
455
465
|
return false;
|
|
@@ -459,8 +469,8 @@ var preferImportType = createRule7({
|
|
|
459
469
|
node,
|
|
460
470
|
messageId: "preferImportType",
|
|
461
471
|
fix(fixer) {
|
|
462
|
-
const
|
|
463
|
-
const fixedSource =
|
|
472
|
+
const sourceText = context.sourceCode.getText(node);
|
|
473
|
+
const fixedSource = sourceText.replace(/^import\s+/, "import type ");
|
|
464
474
|
return fixer.replaceText(node, fixedSource);
|
|
465
475
|
}
|
|
466
476
|
});
|
package/lib/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../package.json","../src/rules/file-kebab-case.ts","../src/rules/jsx-pascal-case.ts","../src/rules/md-filename-case-restriction.ts","../src/rules/no-emoji.ts","../src/rules/no-explicit-return-type.ts","../src/rules/prefer-destructuring-params.ts","../src/rules/prefer-import-type.ts"],"sourcesContent":["import packageJson from \"../package.json\" assert { type: \"json\" };\n\nimport fileKebabCase from \"./rules/file-kebab-case\";\nimport jsxPascalCase from \"./rules/jsx-pascal-case\";\nimport mdFilenameCaseRestriction from \"./rules/md-filename-case-restriction\";\nimport noEmoji from \"./rules/no-emoji\";\nimport noExplicitReturnType from \"./rules/no-explicit-return-type\";\nimport preferDestructuringParams from \"./rules/prefer-destructuring-params\";\nimport preferImportType from \"./rules/prefer-import-type\";\n\nimport type { TSESLint } from \"@typescript-eslint/utils\";\n\nconst meta = {\n name: packageJson.name,\n version: packageJson.version,\n} as const;\n\nconst rules = {\n \"file-kebab-case\": fileKebabCase,\n \"jsx-pascal-case\": jsxPascalCase,\n \"md-filename-case-restriction\": mdFilenameCaseRestriction,\n \"no-emoji\": noEmoji,\n \"no-explicit-return-type\": noExplicitReturnType,\n \"prefer-destructuring-params\": preferDestructuringParams,\n \"prefer-import-type\": preferImportType,\n} as const satisfies Record<string, TSESLint.RuleModule<string, readonly unknown[]>>;\n\nconst plugin = {\n meta,\n rules,\n} as const;\n\nconst baseRules = {\n \"nextfriday/no-emoji\": \"warn\",\n \"nextfriday/file-kebab-case\": \"warn\",\n \"nextfriday/md-filename-case-restriction\": \"warn\",\n \"nextfriday/prefer-destructuring-params\": \"warn\",\n \"nextfriday/no-explicit-return-type\": \"warn\",\n \"nextfriday/prefer-import-type\": \"warn\",\n} as const;\n\nconst baseRecommendedRules = {\n \"nextfriday/no-emoji\": \"error\",\n \"nextfriday/file-kebab-case\": \"error\",\n \"nextfriday/md-filename-case-restriction\": \"error\",\n \"nextfriday/prefer-destructuring-params\": \"error\",\n \"nextfriday/no-explicit-return-type\": \"error\",\n \"nextfriday/prefer-import-type\": \"error\",\n} as const;\n\nconst jsxRules = {\n \"nextfriday/jsx-pascal-case\": \"warn\",\n} as const;\n\nconst jsxRecommendedRules = {\n \"nextfriday/jsx-pascal-case\": \"error\",\n} as const;\n\nconst createConfig = (configRules: Record<string, string>) => ({\n plugins: {\n nextfriday: plugin,\n },\n rules: configRules,\n});\n\nconst configs = {\n base: createConfig(baseRules),\n \"base/recommended\": createConfig(baseRecommendedRules),\n react: createConfig({\n ...baseRules,\n ...jsxRules,\n }),\n \"react/recommended\": createConfig({\n ...baseRecommendedRules,\n ...jsxRecommendedRules,\n }),\n nextjs: createConfig({\n ...baseRules,\n ...jsxRules,\n }),\n \"nextjs/recommended\": createConfig({\n ...baseRecommendedRules,\n ...jsxRecommendedRules,\n }),\n} as const;\n\nconst nextfridayPlugin = {\n meta,\n configs,\n rules,\n} as const;\n\nexport { meta, configs, rules };\n\nexport default nextfridayPlugin;\n","{\n \"name\": \"eslint-plugin-nextfriday\",\n \"version\": \"1.0.1\",\n \"description\": \"A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.\",\n \"keywords\": [\n \"eslint\",\n \"eslintplugin\",\n \"eslint-plugin\",\n \"nextfriday\",\n \"next-friday\",\n \"linting\",\n \"code-quality\",\n \"javascript\",\n \"typescript\",\n \"development-tools\"\n ],\n \"homepage\": \"https://github.com/next-friday/eslint-plugin-nextfriday\",\n \"bugs\": {\n \"url\": \"https://github.com/next-friday/eslint-plugin-nextfriday/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/next-friday/eslint-plugin-nextfriday.git\"\n },\n \"license\": \"MIT\",\n \"author\": \"Next Friday <nextfriday.developer@gmail.com>\",\n \"contributors\": [\n \"@joetakara\"\n ],\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"import\": \"./lib/index.js\",\n \"require\": \"./lib/index.cjs\"\n }\n },\n \"main\": \"lib/index.js\",\n \"types\": \"lib/index.d.ts\",\n \"files\": [\n \"LICENSE\",\n \"README.md\",\n \"CHANGELOG.md\",\n \"docs\",\n \"lib\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"changeset\": \"changeset\",\n \"changeset:publish\": \"npm publish --provenance --access public\",\n \"changeset:version\": \"changeset version\",\n \"clear\": \"rm -rf lib node_modules/.cache .eslintcache\",\n \"eslint\": \"eslint src --ext .js,.ts,.mjs --fix\",\n \"eslint:check\": \"eslint src --ext .js,.ts,.mjs\",\n \"preinstall\": \"npx only-allow pnpm\",\n \"prepare\": \"husky\",\n \"prepublishOnly\": \"pnpm run build\",\n \"prettier\": \"prettier --write .\",\n \"prettier:check\": \"prettier --check .\",\n \"sort-package-json\": \"pnpm exec sort-package-json\",\n \"sort-package-json:check\": \"pnpm exec sort-package-json --check\",\n \"test\": \"jest\",\n \"test:coverage\": \"jest --coverage\",\n \"test:watch\": \"jest --watch\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@typescript-eslint/utils\": \"^8.42.0\",\n \"emoji-regex\": \"^10.5.0\",\n \"tsup\": \"^8.5.0\"\n },\n \"devDependencies\": {\n \"@changesets/changelog-github\": \"^0.5.1\",\n \"@changesets/cli\": \"^2.29.6\",\n \"@commitlint/cli\": \"^19.8.1\",\n \"@commitlint/config-conventional\": \"^19.8.1\",\n \"@eslint/js\": \"^9.35.0\",\n \"@jest/globals\": \"^30.1.2\",\n \"@stylistic/eslint-plugin\": \"^3.1.0\",\n \"@swc/core\": \"^1.13.5\",\n \"@types/eslint\": \"^9.6.1\",\n \"@types/jest\": \"^30.0.0\",\n \"@types/node\": \"^22.5.4\",\n \"@types/ramda\": \"^0.31.0\",\n \"@typescript-eslint/parser\": \"^8.42.0\",\n \"@typescript-eslint/rule-tester\": \"^8.42.0\",\n \"eslint\": \"^9.35.0\",\n \"eslint-config-airbnb-extended\": \"^2.2.0\",\n \"eslint-config-prettier\": \"^10.1.8\",\n \"eslint-import-resolver-typescript\": \"^4.4.4\",\n \"eslint-plugin-import-x\": \"^4.16.1\",\n \"eslint-plugin-jest\": \"^29.0.1\",\n \"eslint-plugin-prettier\": \"^5.5.4\",\n \"eslint-plugin-sonarjs\": \"^3.0.5\",\n \"husky\": \"^9.1.7\",\n \"jest\": \"^29.7.0\",\n \"lint-staged\": \"^16.1.6\",\n \"prettier\": \"^3.6.2\",\n \"sort-package-json\": \"^3.4.0\",\n \"ts-jest\": \"^29.4.1\",\n \"ts-node\": \"^10.9.2\",\n \"typescript\": \"^5.6.2\",\n \"typescript-eslint\": \"^8.42.0\"\n },\n \"peerDependencies\": {\n \"eslint\": \"^9.0.0\"\n },\n \"packageManager\": \"pnpm@9.12.0\",\n \"engines\": {\n \"node\": \">=22.0.0\",\n \"pnpm\": \">=9.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst isKebabCase = (str: string) => {\n if (/\\.(config|rc|setup|spec|test)$/.test(str)) {\n return /^[a-z0-9]+(?:-[a-z0-9]+)*(?:\\.[a-z0-9]+)*$/.test(str);\n }\n return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(str);\n};\n\nconst fileKebabCase = createRule({\n name: \"file-kebab-case\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce kebab-case filenames for .ts and .js files\",\n },\n messages: {\n fileKebabCase: \"File names must be kebab-case\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n const ext = path.extname(filename);\n\n if (ext !== \".ts\" && ext !== \".js\") {\n return;\n }\n\n const basename = path.basename(filename, ext);\n\n if (!isKebabCase(basename)) {\n context.report({\n loc: { line: 1, column: 0 },\n messageId: \"fileKebabCase\",\n });\n }\n },\n };\n },\n});\n\nexport default fileKebabCase;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst isPascalCase = (str: string) => /^[A-Z][a-zA-Z0-9]*$/.test(str) && !/^[A-Z]+$/.test(str);\n\nconst jsxPascalCase = createRule({\n name: \"jsx-pascal-case\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce PascalCase filenames for .jsx and .tsx files\",\n },\n messages: {\n jsxPascalCase: \"JSX/TSX file names must be PascalCase\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n const ext = path.extname(filename);\n\n if (ext !== \".jsx\" && ext !== \".tsx\") {\n return;\n }\n\n const basename = path.basename(filename, ext);\n\n if (!isPascalCase(basename)) {\n context.report({\n loc: { line: 1, column: 0 },\n messageId: \"jsxPascalCase\",\n });\n }\n },\n };\n },\n});\n\nexport default jsxPascalCase;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst mdFilenameCaseRestriction = createRule({\n name: \"md-filename-case-restriction\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce .md filenames to be SNAKE_CASE only\",\n },\n messages: {\n invalidFilenameCase: \"Markdown filename must be SNAKE_CASE (UPPERCASE with underscores). Found: '{{ filename }}'\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n\n if (!filename.endsWith(\".md\")) {\n return;\n }\n\n const basename = path.basename(filename, \".md\");\n\n function isSnakeCase(text: string): boolean {\n return /^[A-Z][A-Z0-9_]*$/.test(text);\n }\n\n function isValidCase(text: string): boolean {\n return isSnakeCase(text);\n }\n\n if (!isValidCase(basename)) {\n context.report({\n node: context.sourceCode.ast,\n messageId: \"invalidFilenameCase\",\n data: { filename: basename },\n });\n }\n },\n };\n },\n});\n\nexport default mdFilenameCaseRestriction;\n","import emojiRegex from \"emoji-regex\";\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst noEmoji = createRule({\n name: \"no-emoji\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow emoji characters in source code\",\n },\n messages: {\n noEmoji: \"Emoji are not allowed in source code\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n return {\n Program() {\n const text = sourceCode.getText();\n const regex = emojiRegex();\n const matches = Array.from(text.matchAll(regex));\n\n matches.forEach((match) => {\n const loc = sourceCode.getLocFromIndex(match.index);\n\n context.report({\n loc,\n messageId: \"noEmoji\",\n });\n });\n },\n };\n },\n});\n\nexport default noEmoji;\n","import { ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst noExplicitReturnType = createRule({\n name: \"no-explicit-return-type\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow explicit return types on functions\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n noExplicitReturnType: \"Remove explicit return type '{{returnType}}' - TypeScript can infer it automatically\",\n },\n },\n defaultOptions: [],\n create(context) {\n const checkFunction = (\n node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression,\n ) => {\n if (node.returnType) {\n const returnTypeText = context.sourceCode.getText(node.returnType);\n context.report({\n node: node.returnType,\n messageId: \"noExplicitReturnType\",\n data: {\n returnType: returnTypeText,\n },\n fix(fixer) {\n return fixer.remove(node.returnType!);\n },\n });\n }\n };\n\n return {\n FunctionDeclaration: checkFunction,\n FunctionExpression: checkFunction,\n ArrowFunctionExpression: checkFunction,\n };\n },\n});\n\nexport default noExplicitReturnType;\n","import { AST_NODE_TYPES, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst preferDestructuringParams = createRule({\n name: \"prefer-destructuring-params\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Enforce destructuring for functions with multiple parameters\",\n },\n messages: {\n preferDestructuring: \"Functions with multiple parameters should use destructuring\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const checkFunction = (\n node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression,\n ) => {\n if (node.params.length <= 1) {\n return;\n }\n\n const hasNonDestructuredParams = node.params.some(\n (param: TSESTree.Parameter) =>\n param.type !== AST_NODE_TYPES.ObjectPattern && param.type !== AST_NODE_TYPES.RestElement,\n );\n\n if (hasNonDestructuredParams) {\n context.report({\n node,\n messageId: \"preferDestructuring\",\n });\n }\n };\n\n return {\n FunctionDeclaration: checkFunction,\n FunctionExpression: checkFunction,\n ArrowFunctionExpression: checkFunction,\n };\n },\n});\n\nexport default preferDestructuringParams;\n","import { AST_NODE_TYPES, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst preferImportType = createRule({\n name: \"prefer-import-type\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Enforce using 'import type' for type-only imports\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n preferImportType: \"Use 'import type' for type-only imports\",\n },\n },\n defaultOptions: [],\n create(context) {\n function checkImportDeclaration(node: TSESTree.ImportDeclaration) {\n if (node.importKind === \"type\") {\n return;\n }\n\n if (\n context.filename.includes(\".test.\") ||\n context.filename.includes(\".spec.\") ||\n context.filename.includes(\"__tests__\")\n ) {\n return;\n }\n\n const isTypeOnlyImport = node.specifiers.every((specifier) => {\n if (specifier.type === AST_NODE_TYPES.ImportDefaultSpecifier) {\n return false;\n }\n if (specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier) {\n return false;\n }\n if (specifier.type === AST_NODE_TYPES.ImportSpecifier) {\n const importedName =\n specifier.imported.type === AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value;\n\n const isKnownTypeOnly =\n (node.source.value === \"@typescript-eslint/utils\" && [\"TSESTree\", \"RuleContext\"].includes(importedName)) ||\n (node.source.value === \"react\" &&\n [\"Component\", \"ComponentProps\", \"ReactNode\", \"FC\", \"JSX\"].includes(importedName)) ||\n importedName.endsWith(\"Type\") ||\n importedName.endsWith(\"Interface\") ||\n importedName.endsWith(\"Props\");\n\n return isKnownTypeOnly;\n }\n return false;\n });\n\n if (isTypeOnlyImport) {\n context.report({\n node,\n messageId: \"preferImportType\",\n fix(fixer) {\n const source = context.sourceCode.getText(node);\n const fixedSource = source.replace(/^import\\s+/, \"import type \");\n return fixer.replaceText(node, fixedSource);\n },\n });\n }\n }\n\n return {\n ImportDeclaration: checkImportDeclaration,\n };\n },\n});\n\nexport default preferImportType;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;A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ule","path","import_path","import_utils","createRule","path","import_utils","createRule","emojiRegex","import_utils","createRule","import_utils","createRule","import_utils","createRule"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../package.json","../src/rules/file-kebab-case.ts","../src/rules/jsx-pascal-case.ts","../src/rules/md-filename-case-restriction.ts","../src/rules/no-emoji.ts","../src/rules/no-explicit-return-type.ts","../src/rules/prefer-destructuring-params.ts","../src/rules/prefer-import-type.ts"],"sourcesContent":["import packageJson from \"../package.json\" assert { type: \"json\" };\n\nimport fileKebabCase from \"./rules/file-kebab-case\";\nimport jsxPascalCase from \"./rules/jsx-pascal-case\";\nimport mdFilenameCaseRestriction from \"./rules/md-filename-case-restriction\";\nimport noEmoji from \"./rules/no-emoji\";\nimport noExplicitReturnType from \"./rules/no-explicit-return-type\";\nimport preferDestructuringParams from \"./rules/prefer-destructuring-params\";\nimport preferImportType from \"./rules/prefer-import-type\";\n\nimport type { TSESLint } from \"@typescript-eslint/utils\";\n\nconst meta = {\n name: packageJson.name,\n version: packageJson.version,\n} as const;\n\nconst rules = {\n \"file-kebab-case\": fileKebabCase,\n \"jsx-pascal-case\": jsxPascalCase,\n \"md-filename-case-restriction\": mdFilenameCaseRestriction,\n \"no-emoji\": noEmoji,\n \"no-explicit-return-type\": noExplicitReturnType,\n \"prefer-destructuring-params\": preferDestructuringParams,\n \"prefer-import-type\": preferImportType,\n} as const satisfies Record<string, TSESLint.RuleModule<string, readonly unknown[]>>;\n\nconst plugin = {\n meta,\n rules,\n} as const;\n\nconst baseRules = {\n \"nextfriday/no-emoji\": \"warn\",\n \"nextfriday/file-kebab-case\": \"warn\",\n \"nextfriday/md-filename-case-restriction\": \"warn\",\n \"nextfriday/prefer-destructuring-params\": \"warn\",\n \"nextfriday/no-explicit-return-type\": \"warn\",\n \"nextfriday/prefer-import-type\": \"warn\",\n} as const;\n\nconst baseRecommendedRules = {\n \"nextfriday/no-emoji\": \"error\",\n \"nextfriday/file-kebab-case\": \"error\",\n \"nextfriday/md-filename-case-restriction\": \"error\",\n \"nextfriday/prefer-destructuring-params\": \"error\",\n \"nextfriday/no-explicit-return-type\": \"error\",\n \"nextfriday/prefer-import-type\": \"error\",\n} as const;\n\nconst jsxRules = {\n \"nextfriday/jsx-pascal-case\": \"warn\",\n} as const;\n\nconst jsxRecommendedRules = {\n \"nextfriday/jsx-pascal-case\": \"error\",\n} as const;\n\nconst createConfig = (configRules: Record<string, string>) => ({\n plugins: {\n nextfriday: plugin,\n },\n rules: configRules,\n});\n\nconst configs = {\n base: createConfig(baseRules),\n \"base/recommended\": createConfig(baseRecommendedRules),\n react: createConfig({\n ...baseRules,\n ...jsxRules,\n }),\n \"react/recommended\": createConfig({\n ...baseRecommendedRules,\n ...jsxRecommendedRules,\n }),\n nextjs: createConfig({\n ...baseRules,\n ...jsxRules,\n }),\n \"nextjs/recommended\": createConfig({\n ...baseRecommendedRules,\n ...jsxRecommendedRules,\n }),\n} as const;\n\nconst nextfridayPlugin = {\n meta,\n configs,\n rules,\n} as const;\n\nexport { meta, configs, rules };\n\nexport default nextfridayPlugin;\n","{\n \"name\": \"eslint-plugin-nextfriday\",\n \"version\": \"1.0.2\",\n \"description\": \"A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.\",\n \"keywords\": [\n \"eslint\",\n \"eslintplugin\",\n \"eslint-plugin\",\n \"nextfriday\",\n \"next-friday\",\n \"linting\",\n \"code-quality\",\n \"javascript\",\n \"typescript\",\n \"development-tools\"\n ],\n \"homepage\": \"https://github.com/next-friday/eslint-plugin-nextfriday\",\n \"bugs\": {\n \"url\": \"https://github.com/next-friday/eslint-plugin-nextfriday/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/next-friday/eslint-plugin-nextfriday.git\"\n },\n \"license\": \"MIT\",\n \"author\": \"Next Friday <nextfriday.developer@gmail.com>\",\n \"contributors\": [\n \"@joetakara\"\n ],\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"import\": \"./lib/index.js\",\n \"require\": \"./lib/index.cjs\"\n }\n },\n \"main\": \"lib/index.js\",\n \"types\": \"lib/index.d.ts\",\n \"files\": [\n \"LICENSE\",\n \"README.md\",\n \"CHANGELOG.md\",\n \"docs\",\n \"lib\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"changeset\": \"changeset\",\n \"changeset:publish\": \"npm publish --provenance --access public\",\n \"changeset:version\": \"changeset version\",\n \"clear\": \"rm -rf lib node_modules/.cache .eslintcache\",\n \"eslint\": \"eslint src --ext .js,.ts,.mjs --fix\",\n \"eslint:check\": \"eslint src --ext .js,.ts,.mjs\",\n \"preinstall\": \"npx only-allow pnpm\",\n \"prepare\": \"husky\",\n \"prepublishOnly\": \"pnpm run build\",\n \"prettier\": \"prettier --write .\",\n \"prettier:check\": \"prettier --check .\",\n \"sort-package-json\": \"pnpm exec sort-package-json\",\n \"sort-package-json:check\": \"pnpm exec sort-package-json --check\",\n \"test\": \"jest\",\n \"test:coverage\": \"jest --coverage\",\n \"test:watch\": \"jest --watch\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@typescript-eslint/utils\": \"^8.42.0\",\n \"emoji-regex\": \"^10.5.0\",\n \"tsup\": \"^8.5.0\"\n },\n \"devDependencies\": {\n \"@changesets/changelog-github\": \"^0.5.1\",\n \"@changesets/cli\": \"^2.29.6\",\n \"@commitlint/cli\": \"^19.8.1\",\n \"@commitlint/config-conventional\": \"^19.8.1\",\n \"@eslint/js\": \"^9.35.0\",\n \"@jest/globals\": \"^30.1.2\",\n \"@stylistic/eslint-plugin\": \"^3.1.0\",\n \"@swc/core\": \"^1.13.5\",\n \"@types/eslint\": \"^9.6.1\",\n \"@types/jest\": \"^30.0.0\",\n \"@types/node\": \"^22.5.4\",\n \"@types/ramda\": \"^0.31.0\",\n \"@typescript-eslint/parser\": \"^8.42.0\",\n \"@typescript-eslint/rule-tester\": \"^8.42.0\",\n \"eslint\": \"^9.35.0\",\n \"eslint-config-airbnb-extended\": \"^2.2.0\",\n \"eslint-config-prettier\": \"^10.1.8\",\n \"eslint-import-resolver-typescript\": \"^4.4.4\",\n \"eslint-plugin-import-x\": \"^4.16.1\",\n \"eslint-plugin-jest\": \"^29.0.1\",\n \"eslint-plugin-prettier\": \"^5.5.4\",\n \"eslint-plugin-sonarjs\": \"^3.0.5\",\n \"husky\": \"^9.1.7\",\n \"jest\": \"^29.7.0\",\n \"lint-staged\": \"^16.1.6\",\n \"prettier\": \"^3.6.2\",\n \"sort-package-json\": \"^3.4.0\",\n \"ts-jest\": \"^29.4.1\",\n \"ts-node\": \"^10.9.2\",\n \"typescript\": \"^5.6.2\",\n \"typescript-eslint\": \"^8.42.0\"\n },\n \"peerDependencies\": {\n \"eslint\": \"^9.0.0\"\n },\n \"packageManager\": \"pnpm@9.12.0\",\n \"engines\": {\n \"node\": \">=22.0.0\",\n \"pnpm\": \">=9.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst isKebabCase = (str: string) => {\n if (/\\.(config|rc|setup|spec|test)$/.test(str)) {\n return /^[a-z0-9]+(?:-[a-z0-9]+)*(?:\\.[a-z0-9]+)*$/.test(str);\n }\n return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(str);\n};\n\nconst fileKebabCase = createRule({\n name: \"file-kebab-case\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce kebab-case filenames for .ts and .js files\",\n },\n messages: {\n fileKebabCase: \"File names must be kebab-case\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n const ext = path.extname(filename);\n\n if (ext !== \".ts\" && ext !== \".js\") {\n return;\n }\n\n const basename = path.basename(filename, ext);\n\n if (!isKebabCase(basename)) {\n context.report({\n loc: { line: 1, column: 0 },\n messageId: \"fileKebabCase\",\n });\n }\n },\n };\n },\n});\n\nexport default fileKebabCase;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst isPascalCase = (str: string) => /^[A-Z][a-zA-Z0-9]*$/.test(str) && !/^[A-Z]+$/.test(str);\n\nconst jsxPascalCase = createRule({\n name: \"jsx-pascal-case\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce PascalCase filenames for .jsx and .tsx files\",\n },\n messages: {\n jsxPascalCase: \"JSX/TSX file names must be PascalCase\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n const ext = path.extname(filename);\n\n if (ext !== \".jsx\" && ext !== \".tsx\") {\n return;\n }\n\n const basename = path.basename(filename, ext);\n\n if (!isPascalCase(basename)) {\n context.report({\n loc: { line: 1, column: 0 },\n messageId: \"jsxPascalCase\",\n });\n }\n },\n };\n },\n});\n\nexport default jsxPascalCase;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst mdFilenameCaseRestriction = createRule({\n name: \"md-filename-case-restriction\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce .md filenames to be SNAKE_CASE only\",\n },\n messages: {\n invalidFilenameCase: \"Markdown filename must be SNAKE_CASE (UPPERCASE with underscores). Found: '{{ filename }}'\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n\n if (!filename.endsWith(\".md\")) {\n return;\n }\n\n const basename = path.basename(filename, \".md\");\n\n function isSnakeCase(text: string): boolean {\n return /^[A-Z][A-Z0-9_]*$/.test(text);\n }\n\n function isValidCase(text: string): boolean {\n return isSnakeCase(text);\n }\n\n if (!isValidCase(basename)) {\n context.report({\n node: context.sourceCode.ast,\n messageId: \"invalidFilenameCase\",\n data: { filename: basename },\n });\n }\n },\n };\n },\n});\n\nexport default mdFilenameCaseRestriction;\n","import emojiRegex from \"emoji-regex\";\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst noEmoji = createRule({\n name: \"no-emoji\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow emoji characters in source code\",\n },\n messages: {\n noEmoji: \"Emoji are not allowed in source code\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n return {\n Program() {\n const text = sourceCode.getText();\n const regex = emojiRegex();\n const matches = Array.from(text.matchAll(regex));\n\n matches.forEach((match) => {\n const loc = sourceCode.getLocFromIndex(match.index);\n\n context.report({\n loc,\n messageId: \"noEmoji\",\n });\n });\n },\n };\n },\n});\n\nexport default noEmoji;\n","import { ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst noExplicitReturnType = createRule({\n name: \"no-explicit-return-type\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow explicit return types on functions\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n noExplicitReturnType: \"Remove explicit return type '{{returnType}}' - TypeScript can infer it automatically\",\n },\n },\n defaultOptions: [],\n create(context) {\n const checkFunction = (\n node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression,\n ) => {\n if (node.returnType) {\n const returnTypeText = context.sourceCode.getText(node.returnType);\n context.report({\n node: node.returnType,\n messageId: \"noExplicitReturnType\",\n data: {\n returnType: returnTypeText,\n },\n fix(fixer) {\n return fixer.remove(node.returnType!);\n },\n });\n }\n };\n\n return {\n FunctionDeclaration: checkFunction,\n FunctionExpression: checkFunction,\n ArrowFunctionExpression: checkFunction,\n };\n },\n});\n\nexport default noExplicitReturnType;\n","import { AST_NODE_TYPES, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst preferDestructuringParams = createRule({\n name: \"prefer-destructuring-params\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Enforce destructuring for functions with multiple parameters\",\n },\n messages: {\n preferDestructuring: \"Functions with multiple parameters should use destructuring\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const checkFunction = (\n node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression,\n ) => {\n if (node.params.length <= 1) {\n return;\n }\n\n const hasNonDestructuredParams = node.params.some(\n (param: TSESTree.Parameter) =>\n param.type !== AST_NODE_TYPES.ObjectPattern && param.type !== AST_NODE_TYPES.RestElement,\n );\n\n if (hasNonDestructuredParams) {\n context.report({\n node,\n messageId: \"preferDestructuring\",\n });\n }\n };\n\n return {\n FunctionDeclaration: checkFunction,\n FunctionExpression: checkFunction,\n ArrowFunctionExpression: checkFunction,\n };\n },\n});\n\nexport default preferDestructuringParams;\n","import { AST_NODE_TYPES, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst preferImportType = createRule({\n name: \"prefer-import-type\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Enforce using 'import type' for type-only imports\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n preferImportType: \"Use 'import type' for type-only imports\",\n },\n },\n defaultOptions: [],\n create(context) {\n function checkImportDeclaration(node: TSESTree.ImportDeclaration) {\n if (node.importKind === \"type\") {\n return;\n }\n\n if (\n context.filename.includes(\".test.\") ||\n context.filename.includes(\".spec.\") ||\n context.filename.includes(\"__tests__\")\n ) {\n return;\n }\n\n if (node.specifiers.length === 0) {\n return;\n }\n\n const source = node.source.value;\n const isRuntimeImport =\n /\\.(css|scss|sass|less|styl)(\\?.*)?$/.test(source) ||\n /\\.(png|jpg|jpeg|gif|svg|webp|ico|bmp)(\\?.*)?$/.test(source) ||\n /\\.(woff|woff2|ttf|eot|otf)(\\?.*)?$/.test(source) ||\n /\\.(mp4|webm|ogg|mp3|wav|flac|aac)(\\?.*)?$/.test(source) ||\n /\\.(json|txt|md|xml|yml|yaml)(\\?.*)?$/.test(source) ||\n /^next\\/(font|image|link|head|script|dynamic|router)/.test(source) ||\n source.includes(\"/font/\") ||\n source === \"react-dom\" ||\n source === \"react-dom/client\" ||\n source === \"react-dom/server\" ||\n source.startsWith(\"@emotion/\") ||\n source.startsWith(\"styled-components\") ||\n source.includes(\"polyfill\") ||\n source.includes(\"shim\") ||\n source === \"styled-jsx/css\" ||\n source.startsWith(\"webpack/\");\n\n if (isRuntimeImport) {\n return;\n }\n\n const isTypeOnlyImport = node.specifiers.every((specifier) => {\n if (specifier.type === AST_NODE_TYPES.ImportDefaultSpecifier) {\n return false;\n }\n if (specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier) {\n return false;\n }\n if (specifier.type === AST_NODE_TYPES.ImportSpecifier) {\n const importedName =\n specifier.imported.type === AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value;\n\n const isKnownTypeOnly =\n (node.source.value === \"@typescript-eslint/utils\" && [\"TSESTree\", \"RuleContext\"].includes(importedName)) ||\n (node.source.value === \"react\" &&\n [\"Component\", \"ComponentProps\", \"ReactNode\", \"FC\", \"JSX\", \"ReactElement\", \"PropsWithChildren\"].includes(\n importedName,\n )) ||\n importedName.endsWith(\"Type\") ||\n importedName.endsWith(\"Interface\") ||\n importedName.endsWith(\"Props\");\n\n return isKnownTypeOnly;\n }\n return false;\n });\n\n if (isTypeOnlyImport) {\n context.report({\n node,\n messageId: \"preferImportType\",\n fix(fixer) {\n const sourceText = context.sourceCode.getText(node);\n const fixedSource = sourceText.replace(/^import\\s+/, \"import type \");\n return fixer.replaceText(node, fixedSource);\n },\n });\n }\n }\n\n return {\n ImportDeclaration: checkImportDeclaration,\n };\n },\n});\n\nexport default preferImportType;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,SAAW;AAAA,EACX,QAAU;AAAA,EACV,cAAgB;AAAA,IACd;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,EACR,SAAW;AAAA,IACT,KAAK;AAAA,MACH,OAAS;AAAA,MACT,QAAU;AAAA,MACV,SAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,EACR,OAAS;AAAA,EACT,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAW;AAAA,IACT,OAAS;AAAA,IACT,WAAa;AAAA,IACb,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,IACrB,OAAS;AAAA,IACT,Q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AY;AAAA,EAChB,uBAAuB;AAAA,EACvB,8BAA8B;AAAA,EAC9B,2CAA2C;AAAA,EAC3C,0CAA0C;AAAA,EAC1C,sCAAsC;AAAA,EACtC,iCAAiC;AACnC;AAEA,IAAM,uBAAuB;AAAA,EAC3B,uBAAuB;AAAA,EACvB,8BAA8B;AAAA,EAC9B,2CAA2C;AAAA,EAC3C,0CAA0C;AAAA,EAC1C,sCAAsC;AAAA,EACtC,iCAAiC;AACnC;AAEA,IAAM,WAAW;AAAA,EACf,8BAA8B;AAChC;AAEA,IAAM,sBAAsB;AAAA,EAC1B,8BAA8B;AAChC;AAEA,IAAM,eAAe,CAAC,iBAAyC;AAAA,EAC7D,SAAS;AAAA,IACP,YAAY;AAAA,EACd;AAAA,EACA,OAAO;AACT;AAEA,IAAM,UAAU;AAAA,EACd,MAAM,aAAa,SAAS;AAAA,EAC5B,oBAAoB,aAAa,oBAAoB;AAAA,EACrD,OAAO,aAAa;AAAA,IAClB,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AAAA,EACD,qBAAqB,aAAa;AAAA,IAChC,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AAAA,EACD,QAAQ,aAAa;AAAA,IACnB,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AAAA,EACD,sBAAsB,aAAa;AAAA,IACjC,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AACH;AAEA,IAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF;AAIA,IAAO,gBAAQ;","names":["path","import_path","import_utils","createRule","path","import_path","import_utils","createRule","path","import_utils","createRule","emojiRegex","import_utils","createRule","import_utils","createRule","import_utils","createRule"]}
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "eslint-plugin-nextfriday",
|
|
4
|
-
version: "1.0.
|
|
4
|
+
version: "1.0.2",
|
|
5
5
|
description: "A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.",
|
|
6
6
|
keywords: [
|
|
7
7
|
"eslint",
|
|
@@ -401,6 +401,14 @@ var preferImportType = createRule7({
|
|
|
401
401
|
if (context.filename.includes(".test.") || context.filename.includes(".spec.") || context.filename.includes("__tests__")) {
|
|
402
402
|
return;
|
|
403
403
|
}
|
|
404
|
+
if (node.specifiers.length === 0) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
const source = node.source.value;
|
|
408
|
+
const isRuntimeImport = /\.(css|scss|sass|less|styl)(\?.*)?$/.test(source) || /\.(png|jpg|jpeg|gif|svg|webp|ico|bmp)(\?.*)?$/.test(source) || /\.(woff|woff2|ttf|eot|otf)(\?.*)?$/.test(source) || /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/.test(source) || /\.(json|txt|md|xml|yml|yaml)(\?.*)?$/.test(source) || /^next\/(font|image|link|head|script|dynamic|router)/.test(source) || source.includes("/font/") || source === "react-dom" || source === "react-dom/client" || source === "react-dom/server" || source.startsWith("@emotion/") || source.startsWith("styled-components") || source.includes("polyfill") || source.includes("shim") || source === "styled-jsx/css" || source.startsWith("webpack/");
|
|
409
|
+
if (isRuntimeImport) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
404
412
|
const isTypeOnlyImport = node.specifiers.every((specifier) => {
|
|
405
413
|
if (specifier.type === AST_NODE_TYPES2.ImportDefaultSpecifier) {
|
|
406
414
|
return false;
|
|
@@ -410,7 +418,9 @@ var preferImportType = createRule7({
|
|
|
410
418
|
}
|
|
411
419
|
if (specifier.type === AST_NODE_TYPES2.ImportSpecifier) {
|
|
412
420
|
const importedName = specifier.imported.type === AST_NODE_TYPES2.Identifier ? specifier.imported.name : specifier.imported.value;
|
|
413
|
-
const isKnownTypeOnly = node.source.value === "@typescript-eslint/utils" && ["TSESTree", "RuleContext"].includes(importedName) || node.source.value === "react" && ["Component", "ComponentProps", "ReactNode", "FC", "JSX"
|
|
421
|
+
const isKnownTypeOnly = node.source.value === "@typescript-eslint/utils" && ["TSESTree", "RuleContext"].includes(importedName) || node.source.value === "react" && ["Component", "ComponentProps", "ReactNode", "FC", "JSX", "ReactElement", "PropsWithChildren"].includes(
|
|
422
|
+
importedName
|
|
423
|
+
) || importedName.endsWith("Type") || importedName.endsWith("Interface") || importedName.endsWith("Props");
|
|
414
424
|
return isKnownTypeOnly;
|
|
415
425
|
}
|
|
416
426
|
return false;
|
|
@@ -420,8 +430,8 @@ var preferImportType = createRule7({
|
|
|
420
430
|
node,
|
|
421
431
|
messageId: "preferImportType",
|
|
422
432
|
fix(fixer) {
|
|
423
|
-
const
|
|
424
|
-
const fixedSource =
|
|
433
|
+
const sourceText = context.sourceCode.getText(node);
|
|
434
|
+
const fixedSource = sourceText.replace(/^import\s+/, "import type ");
|
|
425
435
|
return fixer.replaceText(node, fixedSource);
|
|
426
436
|
}
|
|
427
437
|
});
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/rules/file-kebab-case.ts","../src/rules/jsx-pascal-case.ts","../src/rules/md-filename-case-restriction.ts","../src/rules/no-emoji.ts","../src/rules/no-explicit-return-type.ts","../src/rules/prefer-destructuring-params.ts","../src/rules/prefer-import-type.ts","../src/index.ts"],"sourcesContent":["{\n \"name\": \"eslint-plugin-nextfriday\",\n \"version\": \"1.0.1\",\n \"description\": \"A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.\",\n \"keywords\": [\n \"eslint\",\n \"eslintplugin\",\n \"eslint-plugin\",\n \"nextfriday\",\n \"next-friday\",\n \"linting\",\n \"code-quality\",\n \"javascript\",\n \"typescript\",\n \"development-tools\"\n ],\n \"homepage\": \"https://github.com/next-friday/eslint-plugin-nextfriday\",\n \"bugs\": {\n \"url\": \"https://github.com/next-friday/eslint-plugin-nextfriday/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/next-friday/eslint-plugin-nextfriday.git\"\n },\n \"license\": \"MIT\",\n \"author\": \"Next Friday <nextfriday.developer@gmail.com>\",\n \"contributors\": [\n \"@joetakara\"\n ],\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"import\": \"./lib/index.js\",\n \"require\": \"./lib/index.cjs\"\n }\n },\n \"main\": \"lib/index.js\",\n \"types\": \"lib/index.d.ts\",\n \"files\": [\n \"LICENSE\",\n \"README.md\",\n \"CHANGELOG.md\",\n \"docs\",\n \"lib\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"changeset\": \"changeset\",\n \"changeset:publish\": \"npm publish --provenance --access public\",\n \"changeset:version\": \"changeset version\",\n \"clear\": \"rm -rf lib node_modules/.cache .eslintcache\",\n \"eslint\": \"eslint src --ext .js,.ts,.mjs --fix\",\n \"eslint:check\": \"eslint src --ext .js,.ts,.mjs\",\n \"preinstall\": \"npx only-allow pnpm\",\n \"prepare\": \"husky\",\n \"prepublishOnly\": \"pnpm run build\",\n \"prettier\": \"prettier --write .\",\n \"prettier:check\": \"prettier --check .\",\n \"sort-package-json\": \"pnpm exec sort-package-json\",\n \"sort-package-json:check\": \"pnpm exec sort-package-json --check\",\n \"test\": \"jest\",\n \"test:coverage\": \"jest --coverage\",\n \"test:watch\": \"jest --watch\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@typescript-eslint/utils\": \"^8.42.0\",\n \"emoji-regex\": \"^10.5.0\",\n \"tsup\": \"^8.5.0\"\n },\n \"devDependencies\": {\n \"@changesets/changelog-github\": \"^0.5.1\",\n \"@changesets/cli\": \"^2.29.6\",\n \"@commitlint/cli\": \"^19.8.1\",\n \"@commitlint/config-conventional\": \"^19.8.1\",\n \"@eslint/js\": \"^9.35.0\",\n \"@jest/globals\": \"^30.1.2\",\n \"@stylistic/eslint-plugin\": \"^3.1.0\",\n \"@swc/core\": \"^1.13.5\",\n \"@types/eslint\": \"^9.6.1\",\n \"@types/jest\": \"^30.0.0\",\n \"@types/node\": \"^22.5.4\",\n \"@types/ramda\": \"^0.31.0\",\n \"@typescript-eslint/parser\": \"^8.42.0\",\n \"@typescript-eslint/rule-tester\": \"^8.42.0\",\n \"eslint\": \"^9.35.0\",\n \"eslint-config-airbnb-extended\": \"^2.2.0\",\n \"eslint-config-prettier\": \"^10.1.8\",\n \"eslint-import-resolver-typescript\": \"^4.4.4\",\n \"eslint-plugin-import-x\": \"^4.16.1\",\n \"eslint-plugin-jest\": \"^29.0.1\",\n \"eslint-plugin-prettier\": \"^5.5.4\",\n \"eslint-plugin-sonarjs\": \"^3.0.5\",\n \"husky\": \"^9.1.7\",\n \"jest\": \"^29.7.0\",\n \"lint-staged\": \"^16.1.6\",\n \"prettier\": \"^3.6.2\",\n \"sort-package-json\": \"^3.4.0\",\n \"ts-jest\": \"^29.4.1\",\n \"ts-node\": \"^10.9.2\",\n \"typescript\": \"^5.6.2\",\n \"typescript-eslint\": \"^8.42.0\"\n },\n \"peerDependencies\": {\n \"eslint\": \"^9.0.0\"\n },\n \"packageManager\": \"pnpm@9.12.0\",\n \"engines\": {\n \"node\": \">=22.0.0\",\n \"pnpm\": \">=9.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst isKebabCase = (str: string) => {\n if (/\\.(config|rc|setup|spec|test)$/.test(str)) {\n return /^[a-z0-9]+(?:-[a-z0-9]+)*(?:\\.[a-z0-9]+)*$/.test(str);\n }\n return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(str);\n};\n\nconst fileKebabCase = createRule({\n name: \"file-kebab-case\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce kebab-case filenames for .ts and .js files\",\n },\n messages: {\n fileKebabCase: \"File names must be kebab-case\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n const ext = path.extname(filename);\n\n if (ext !== \".ts\" && ext !== \".js\") {\n return;\n }\n\n const basename = path.basename(filename, ext);\n\n if (!isKebabCase(basename)) {\n context.report({\n loc: { line: 1, column: 0 },\n messageId: \"fileKebabCase\",\n });\n }\n },\n };\n },\n});\n\nexport default fileKebabCase;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst isPascalCase = (str: string) => /^[A-Z][a-zA-Z0-9]*$/.test(str) && !/^[A-Z]+$/.test(str);\n\nconst jsxPascalCase = createRule({\n name: \"jsx-pascal-case\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce PascalCase filenames for .jsx and .tsx files\",\n },\n messages: {\n jsxPascalCase: \"JSX/TSX file names must be PascalCase\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n const ext = path.extname(filename);\n\n if (ext !== \".jsx\" && ext !== \".tsx\") {\n return;\n }\n\n const basename = path.basename(filename, ext);\n\n if (!isPascalCase(basename)) {\n context.report({\n loc: { line: 1, column: 0 },\n messageId: \"jsxPascalCase\",\n });\n }\n },\n };\n },\n});\n\nexport default jsxPascalCase;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst mdFilenameCaseRestriction = createRule({\n name: \"md-filename-case-restriction\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce .md filenames to be SNAKE_CASE only\",\n },\n messages: {\n invalidFilenameCase: \"Markdown filename must be SNAKE_CASE (UPPERCASE with underscores). Found: '{{ filename }}'\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n\n if (!filename.endsWith(\".md\")) {\n return;\n }\n\n const basename = path.basename(filename, \".md\");\n\n function isSnakeCase(text: string): boolean {\n return /^[A-Z][A-Z0-9_]*$/.test(text);\n }\n\n function isValidCase(text: string): boolean {\n return isSnakeCase(text);\n }\n\n if (!isValidCase(basename)) {\n context.report({\n node: context.sourceCode.ast,\n messageId: \"invalidFilenameCase\",\n data: { filename: basename },\n });\n }\n },\n };\n },\n});\n\nexport default mdFilenameCaseRestriction;\n","import emojiRegex from \"emoji-regex\";\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst noEmoji = createRule({\n name: \"no-emoji\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow emoji characters in source code\",\n },\n messages: {\n noEmoji: \"Emoji are not allowed in source code\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n return {\n Program() {\n const text = sourceCode.getText();\n const regex = emojiRegex();\n const matches = Array.from(text.matchAll(regex));\n\n matches.forEach((match) => {\n const loc = sourceCode.getLocFromIndex(match.index);\n\n context.report({\n loc,\n messageId: \"noEmoji\",\n });\n });\n },\n };\n },\n});\n\nexport default noEmoji;\n","import { ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst noExplicitReturnType = createRule({\n name: \"no-explicit-return-type\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow explicit return types on functions\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n noExplicitReturnType: \"Remove explicit return type '{{returnType}}' - TypeScript can infer it automatically\",\n },\n },\n defaultOptions: [],\n create(context) {\n const checkFunction = (\n node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression,\n ) => {\n if (node.returnType) {\n const returnTypeText = context.sourceCode.getText(node.returnType);\n context.report({\n node: node.returnType,\n messageId: \"noExplicitReturnType\",\n data: {\n returnType: returnTypeText,\n },\n fix(fixer) {\n return fixer.remove(node.returnType!);\n },\n });\n }\n };\n\n return {\n FunctionDeclaration: checkFunction,\n FunctionExpression: checkFunction,\n ArrowFunctionExpression: checkFunction,\n };\n },\n});\n\nexport default noExplicitReturnType;\n","import { AST_NODE_TYPES, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst preferDestructuringParams = createRule({\n name: \"prefer-destructuring-params\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Enforce destructuring for functions with multiple parameters\",\n },\n messages: {\n preferDestructuring: \"Functions with multiple parameters should use destructuring\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const checkFunction = (\n node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression,\n ) => {\n if (node.params.length <= 1) {\n return;\n }\n\n const hasNonDestructuredParams = node.params.some(\n (param: TSESTree.Parameter) =>\n param.type !== AST_NODE_TYPES.ObjectPattern && param.type !== AST_NODE_TYPES.RestElement,\n );\n\n if (hasNonDestructuredParams) {\n context.report({\n node,\n messageId: \"preferDestructuring\",\n });\n }\n };\n\n return {\n FunctionDeclaration: checkFunction,\n FunctionExpression: checkFunction,\n ArrowFunctionExpression: checkFunction,\n };\n },\n});\n\nexport default preferDestructuringParams;\n","import { AST_NODE_TYPES, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst preferImportType = createRule({\n name: \"prefer-import-type\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Enforce using 'import type' for type-only imports\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n preferImportType: \"Use 'import type' for type-only imports\",\n },\n },\n defaultOptions: [],\n create(context) {\n function checkImportDeclaration(node: TSESTree.ImportDeclaration) {\n if (node.importKind === \"type\") {\n return;\n }\n\n if (\n context.filename.includes(\".test.\") ||\n context.filename.includes(\".spec.\") ||\n context.filename.includes(\"__tests__\")\n ) {\n return;\n }\n\n const isTypeOnlyImport = node.specifiers.every((specifier) => {\n if (specifier.type === AST_NODE_TYPES.ImportDefaultSpecifier) {\n return false;\n }\n if (specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier) {\n return false;\n }\n if (specifier.type === AST_NODE_TYPES.ImportSpecifier) {\n const importedName =\n specifier.imported.type === AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value;\n\n const isKnownTypeOnly =\n (node.source.value === \"@typescript-eslint/utils\" && [\"TSESTree\", \"RuleContext\"].includes(importedName)) ||\n (node.source.value === \"react\" &&\n [\"Component\", \"ComponentProps\", \"ReactNode\", \"FC\", \"JSX\"].includes(importedName)) ||\n importedName.endsWith(\"Type\") ||\n importedName.endsWith(\"Interface\") ||\n importedName.endsWith(\"Props\");\n\n return isKnownTypeOnly;\n }\n return false;\n });\n\n if (isTypeOnlyImport) {\n context.report({\n node,\n messageId: \"preferImportType\",\n fix(fixer) {\n const source = context.sourceCode.getText(node);\n const fixedSource = source.replace(/^import\\s+/, \"import type \");\n return fixer.replaceText(node, fixedSource);\n },\n });\n }\n }\n\n return {\n ImportDeclaration: checkImportDeclaration,\n };\n },\n});\n\nexport default preferImportType;\n","import packageJson from \"../package.json\" assert { type: \"json\" };\n\nimport fileKebabCase from \"./rules/file-kebab-case\";\nimport jsxPascalCase from \"./rules/jsx-pascal-case\";\nimport mdFilenameCaseRestriction from \"./rules/md-filename-case-restriction\";\nimport noEmoji from \"./rules/no-emoji\";\nimport noExplicitReturnType from \"./rules/no-explicit-return-type\";\nimport preferDestructuringParams from \"./rules/prefer-destructuring-params\";\nimport preferImportType from \"./rules/prefer-import-type\";\n\nimport type { TSESLint } from \"@typescript-eslint/utils\";\n\nconst meta = {\n name: packageJson.name,\n version: packageJson.version,\n} as const;\n\nconst rules = {\n \"file-kebab-case\": fileKebabCase,\n \"jsx-pascal-case\": jsxPascalCase,\n \"md-filename-case-restriction\": mdFilenameCaseRestriction,\n \"no-emoji\": noEmoji,\n \"no-explicit-return-type\": noExplicitReturnType,\n \"prefer-destructuring-params\": preferDestructuringParams,\n \"prefer-import-type\": preferImportType,\n} as const satisfies Record<string, TSESLint.RuleModule<string, readonly unknown[]>>;\n\nconst plugin = {\n meta,\n rules,\n} as const;\n\nconst baseRules = {\n \"nextfriday/no-emoji\": \"warn\",\n \"nextfriday/file-kebab-case\": \"warn\",\n \"nextfriday/md-filename-case-restriction\": \"warn\",\n \"nextfriday/prefer-destructuring-params\": \"warn\",\n \"nextfriday/no-explicit-return-type\": \"warn\",\n \"nextfriday/prefer-import-type\": \"warn\",\n} as const;\n\nconst baseRecommendedRules = {\n \"nextfriday/no-emoji\": \"error\",\n \"nextfriday/file-kebab-case\": \"error\",\n \"nextfriday/md-filename-case-restriction\": \"error\",\n \"nextfriday/prefer-destructuring-params\": \"error\",\n \"nextfriday/no-explicit-return-type\": \"error\",\n \"nextfriday/prefer-import-type\": \"error\",\n} as const;\n\nconst jsxRules = {\n \"nextfriday/jsx-pascal-case\": \"warn\",\n} as const;\n\nconst jsxRecommendedRules = {\n \"nextfriday/jsx-pascal-case\": \"error\",\n} as const;\n\nconst createConfig = (configRules: Record<string, string>) => ({\n plugins: {\n nextfriday: plugin,\n },\n rules: configRules,\n});\n\nconst configs = {\n base: createConfig(baseRules),\n \"base/recommended\": createConfig(baseRecommendedRules),\n react: createConfig({\n ...baseRules,\n ...jsxRules,\n }),\n \"react/recommended\": createConfig({\n ...baseRecommendedRules,\n ...jsxRecommendedRules,\n }),\n nextjs: createConfig({\n ...baseRules,\n ...jsxRules,\n }),\n \"nextjs/recommended\": createConfig({\n ...baseRecommendedRules,\n ...jsxRecommendedRules,\n }),\n} as const;\n\nconst nextfridayPlugin = {\n meta,\n configs,\n rules,\n} as const;\n\nexport { meta, configs, rules };\n\nexport default nextfridayPlugin;\n"],"mappings":";AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,SAAW;AAAA,EACX,QAAU;AAAA,EACV,cAAgB;AAAA,IACd;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,EACR,SAAW;AAAA,IACT,KAAK;AAAA,MACH,OAAS;AAAA,MACT,QAAU;AAAA,MACV,SAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,EACR,OAAS;AAAA,EACT,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAW;AAAA,IACT,OAAS;AAAA,IACT,WAAa;AAAA,IACb,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,IACrB,OAAS;AAAA,IACT,QAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,YAAc;AAAA,IACd,SAAW;AAAA,IACX,gBAAkB;AAAA,IAClB,UAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,qBAAqB;AAAA,IACrB,2BAA2B;AAAA,IAC3B,MAAQ;AAAA,I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AChC,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AAAA,EACD,QAAQ,aAAa;AAAA,IACnB,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AAAA,EACD,sBAAsB,aAAa;AAAA,IACjC,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AACH;AAEA,IAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF;AAIA,IAAO,gBAAQ;","names":["path","ESLintUtils","createRule","path","ESLintUtils","createRule","ESLintUtils","createRule","ESLintUtils","createRule","ESLintUtils","createRule","AST_NODE_TYPES","ESLintUtils","createRule"]}
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/rules/file-kebab-case.ts","../src/rules/jsx-pascal-case.ts","../src/rules/md-filename-case-restriction.ts","../src/rules/no-emoji.ts","../src/rules/no-explicit-return-type.ts","../src/rules/prefer-destructuring-params.ts","../src/rules/prefer-import-type.ts","../src/index.ts"],"sourcesContent":["{\n \"name\": \"eslint-plugin-nextfriday\",\n \"version\": \"1.0.2\",\n \"description\": \"A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.\",\n \"keywords\": [\n \"eslint\",\n \"eslintplugin\",\n \"eslint-plugin\",\n \"nextfriday\",\n \"next-friday\",\n \"linting\",\n \"code-quality\",\n \"javascript\",\n \"typescript\",\n \"development-tools\"\n ],\n \"homepage\": \"https://github.com/next-friday/eslint-plugin-nextfriday\",\n \"bugs\": {\n \"url\": \"https://github.com/next-friday/eslint-plugin-nextfriday/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/next-friday/eslint-plugin-nextfriday.git\"\n },\n \"license\": \"MIT\",\n \"author\": \"Next Friday <nextfriday.developer@gmail.com>\",\n \"contributors\": [\n \"@joetakara\"\n ],\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"import\": \"./lib/index.js\",\n \"require\": \"./lib/index.cjs\"\n }\n },\n \"main\": \"lib/index.js\",\n \"types\": \"lib/index.d.ts\",\n \"files\": [\n \"LICENSE\",\n \"README.md\",\n \"CHANGELOG.md\",\n \"docs\",\n \"lib\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"changeset\": \"changeset\",\n \"changeset:publish\": \"npm publish --provenance --access public\",\n \"changeset:version\": \"changeset version\",\n \"clear\": \"rm -rf lib node_modules/.cache .eslintcache\",\n \"eslint\": \"eslint src --ext .js,.ts,.mjs --fix\",\n \"eslint:check\": \"eslint src --ext .js,.ts,.mjs\",\n \"preinstall\": \"npx only-allow pnpm\",\n \"prepare\": \"husky\",\n \"prepublishOnly\": \"pnpm run build\",\n \"prettier\": \"prettier --write .\",\n \"prettier:check\": \"prettier --check .\",\n \"sort-package-json\": \"pnpm exec sort-package-json\",\n \"sort-package-json:check\": \"pnpm exec sort-package-json --check\",\n \"test\": \"jest\",\n \"test:coverage\": \"jest --coverage\",\n \"test:watch\": \"jest --watch\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@typescript-eslint/utils\": \"^8.42.0\",\n \"emoji-regex\": \"^10.5.0\",\n \"tsup\": \"^8.5.0\"\n },\n \"devDependencies\": {\n \"@changesets/changelog-github\": \"^0.5.1\",\n \"@changesets/cli\": \"^2.29.6\",\n \"@commitlint/cli\": \"^19.8.1\",\n \"@commitlint/config-conventional\": \"^19.8.1\",\n \"@eslint/js\": \"^9.35.0\",\n \"@jest/globals\": \"^30.1.2\",\n \"@stylistic/eslint-plugin\": \"^3.1.0\",\n \"@swc/core\": \"^1.13.5\",\n \"@types/eslint\": \"^9.6.1\",\n \"@types/jest\": \"^30.0.0\",\n \"@types/node\": \"^22.5.4\",\n \"@types/ramda\": \"^0.31.0\",\n \"@typescript-eslint/parser\": \"^8.42.0\",\n \"@typescript-eslint/rule-tester\": \"^8.42.0\",\n \"eslint\": \"^9.35.0\",\n \"eslint-config-airbnb-extended\": \"^2.2.0\",\n \"eslint-config-prettier\": \"^10.1.8\",\n \"eslint-import-resolver-typescript\": \"^4.4.4\",\n \"eslint-plugin-import-x\": \"^4.16.1\",\n \"eslint-plugin-jest\": \"^29.0.1\",\n \"eslint-plugin-prettier\": \"^5.5.4\",\n \"eslint-plugin-sonarjs\": \"^3.0.5\",\n \"husky\": \"^9.1.7\",\n \"jest\": \"^29.7.0\",\n \"lint-staged\": \"^16.1.6\",\n \"prettier\": \"^3.6.2\",\n \"sort-package-json\": \"^3.4.0\",\n \"ts-jest\": \"^29.4.1\",\n \"ts-node\": \"^10.9.2\",\n \"typescript\": \"^5.6.2\",\n \"typescript-eslint\": \"^8.42.0\"\n },\n \"peerDependencies\": {\n \"eslint\": \"^9.0.0\"\n },\n \"packageManager\": \"pnpm@9.12.0\",\n \"engines\": {\n \"node\": \">=22.0.0\",\n \"pnpm\": \">=9.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst isKebabCase = (str: string) => {\n if (/\\.(config|rc|setup|spec|test)$/.test(str)) {\n return /^[a-z0-9]+(?:-[a-z0-9]+)*(?:\\.[a-z0-9]+)*$/.test(str);\n }\n return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(str);\n};\n\nconst fileKebabCase = createRule({\n name: \"file-kebab-case\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce kebab-case filenames for .ts and .js files\",\n },\n messages: {\n fileKebabCase: \"File names must be kebab-case\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n const ext = path.extname(filename);\n\n if (ext !== \".ts\" && ext !== \".js\") {\n return;\n }\n\n const basename = path.basename(filename, ext);\n\n if (!isKebabCase(basename)) {\n context.report({\n loc: { line: 1, column: 0 },\n messageId: \"fileKebabCase\",\n });\n }\n },\n };\n },\n});\n\nexport default fileKebabCase;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst isPascalCase = (str: string) => /^[A-Z][a-zA-Z0-9]*$/.test(str) && !/^[A-Z]+$/.test(str);\n\nconst jsxPascalCase = createRule({\n name: \"jsx-pascal-case\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce PascalCase filenames for .jsx and .tsx files\",\n },\n messages: {\n jsxPascalCase: \"JSX/TSX file names must be PascalCase\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n const ext = path.extname(filename);\n\n if (ext !== \".jsx\" && ext !== \".tsx\") {\n return;\n }\n\n const basename = path.basename(filename, ext);\n\n if (!isPascalCase(basename)) {\n context.report({\n loc: { line: 1, column: 0 },\n messageId: \"jsxPascalCase\",\n });\n }\n },\n };\n },\n});\n\nexport default jsxPascalCase;\n","import path from \"path\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst mdFilenameCaseRestriction = createRule({\n name: \"md-filename-case-restriction\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce .md filenames to be SNAKE_CASE only\",\n },\n messages: {\n invalidFilenameCase: \"Markdown filename must be SNAKE_CASE (UPPERCASE with underscores). Found: '{{ filename }}'\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n Program() {\n const { filename } = context;\n\n if (!filename.endsWith(\".md\")) {\n return;\n }\n\n const basename = path.basename(filename, \".md\");\n\n function isSnakeCase(text: string): boolean {\n return /^[A-Z][A-Z0-9_]*$/.test(text);\n }\n\n function isValidCase(text: string): boolean {\n return isSnakeCase(text);\n }\n\n if (!isValidCase(basename)) {\n context.report({\n node: context.sourceCode.ast,\n messageId: \"invalidFilenameCase\",\n data: { filename: basename },\n });\n }\n },\n };\n },\n});\n\nexport default mdFilenameCaseRestriction;\n","import emojiRegex from \"emoji-regex\";\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst noEmoji = createRule({\n name: \"no-emoji\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow emoji characters in source code\",\n },\n messages: {\n noEmoji: \"Emoji are not allowed in source code\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n return {\n Program() {\n const text = sourceCode.getText();\n const regex = emojiRegex();\n const matches = Array.from(text.matchAll(regex));\n\n matches.forEach((match) => {\n const loc = sourceCode.getLocFromIndex(match.index);\n\n context.report({\n loc,\n messageId: \"noEmoji\",\n });\n });\n },\n };\n },\n});\n\nexport default noEmoji;\n","import { ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst noExplicitReturnType = createRule({\n name: \"no-explicit-return-type\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow explicit return types on functions\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n noExplicitReturnType: \"Remove explicit return type '{{returnType}}' - TypeScript can infer it automatically\",\n },\n },\n defaultOptions: [],\n create(context) {\n const checkFunction = (\n node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression,\n ) => {\n if (node.returnType) {\n const returnTypeText = context.sourceCode.getText(node.returnType);\n context.report({\n node: node.returnType,\n messageId: \"noExplicitReturnType\",\n data: {\n returnType: returnTypeText,\n },\n fix(fixer) {\n return fixer.remove(node.returnType!);\n },\n });\n }\n };\n\n return {\n FunctionDeclaration: checkFunction,\n FunctionExpression: checkFunction,\n ArrowFunctionExpression: checkFunction,\n };\n },\n});\n\nexport default noExplicitReturnType;\n","import { AST_NODE_TYPES, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst preferDestructuringParams = createRule({\n name: \"prefer-destructuring-params\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Enforce destructuring for functions with multiple parameters\",\n },\n messages: {\n preferDestructuring: \"Functions with multiple parameters should use destructuring\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const checkFunction = (\n node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression,\n ) => {\n if (node.params.length <= 1) {\n return;\n }\n\n const hasNonDestructuredParams = node.params.some(\n (param: TSESTree.Parameter) =>\n param.type !== AST_NODE_TYPES.ObjectPattern && param.type !== AST_NODE_TYPES.RestElement,\n );\n\n if (hasNonDestructuredParams) {\n context.report({\n node,\n messageId: \"preferDestructuring\",\n });\n }\n };\n\n return {\n FunctionDeclaration: checkFunction,\n FunctionExpression: checkFunction,\n ArrowFunctionExpression: checkFunction,\n };\n },\n});\n\nexport default preferDestructuringParams;\n","import { AST_NODE_TYPES, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/next-friday/eslint-plugin-nextfriday/blob/main/docs/rules/${name}.md`,\n);\n\nconst preferImportType = createRule({\n name: \"prefer-import-type\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Enforce using 'import type' for type-only imports\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n preferImportType: \"Use 'import type' for type-only imports\",\n },\n },\n defaultOptions: [],\n create(context) {\n function checkImportDeclaration(node: TSESTree.ImportDeclaration) {\n if (node.importKind === \"type\") {\n return;\n }\n\n if (\n context.filename.includes(\".test.\") ||\n context.filename.includes(\".spec.\") ||\n context.filename.includes(\"__tests__\")\n ) {\n return;\n }\n\n if (node.specifiers.length === 0) {\n return;\n }\n\n const source = node.source.value;\n const isRuntimeImport =\n /\\.(css|scss|sass|less|styl)(\\?.*)?$/.test(source) ||\n /\\.(png|jpg|jpeg|gif|svg|webp|ico|bmp)(\\?.*)?$/.test(source) ||\n /\\.(woff|woff2|ttf|eot|otf)(\\?.*)?$/.test(source) ||\n /\\.(mp4|webm|ogg|mp3|wav|flac|aac)(\\?.*)?$/.test(source) ||\n /\\.(json|txt|md|xml|yml|yaml)(\\?.*)?$/.test(source) ||\n /^next\\/(font|image|link|head|script|dynamic|router)/.test(source) ||\n source.includes(\"/font/\") ||\n source === \"react-dom\" ||\n source === \"react-dom/client\" ||\n source === \"react-dom/server\" ||\n source.startsWith(\"@emotion/\") ||\n source.startsWith(\"styled-components\") ||\n source.includes(\"polyfill\") ||\n source.includes(\"shim\") ||\n source === \"styled-jsx/css\" ||\n source.startsWith(\"webpack/\");\n\n if (isRuntimeImport) {\n return;\n }\n\n const isTypeOnlyImport = node.specifiers.every((specifier) => {\n if (specifier.type === AST_NODE_TYPES.ImportDefaultSpecifier) {\n return false;\n }\n if (specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier) {\n return false;\n }\n if (specifier.type === AST_NODE_TYPES.ImportSpecifier) {\n const importedName =\n specifier.imported.type === AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value;\n\n const isKnownTypeOnly =\n (node.source.value === \"@typescript-eslint/utils\" && [\"TSESTree\", \"RuleContext\"].includes(importedName)) ||\n (node.source.value === \"react\" &&\n [\"Component\", \"ComponentProps\", \"ReactNode\", \"FC\", \"JSX\", \"ReactElement\", \"PropsWithChildren\"].includes(\n importedName,\n )) ||\n importedName.endsWith(\"Type\") ||\n importedName.endsWith(\"Interface\") ||\n importedName.endsWith(\"Props\");\n\n return isKnownTypeOnly;\n }\n return false;\n });\n\n if (isTypeOnlyImport) {\n context.report({\n node,\n messageId: \"preferImportType\",\n fix(fixer) {\n const sourceText = context.sourceCode.getText(node);\n const fixedSource = sourceText.replace(/^import\\s+/, \"import type \");\n return fixer.replaceText(node, fixedSource);\n },\n });\n }\n }\n\n return {\n ImportDeclaration: checkImportDeclaration,\n };\n },\n});\n\nexport default preferImportType;\n","import packageJson from \"../package.json\" assert { type: \"json\" };\n\nimport fileKebabCase from \"./rules/file-kebab-case\";\nimport jsxPascalCase from \"./rules/jsx-pascal-case\";\nimport mdFilenameCaseRestriction from \"./rules/md-filename-case-restriction\";\nimport noEmoji from \"./rules/no-emoji\";\nimport noExplicitReturnType from \"./rules/no-explicit-return-type\";\nimport preferDestructuringParams from \"./rules/prefer-destructuring-params\";\nimport preferImportType from \"./rules/prefer-import-type\";\n\nimport type { TSESLint } from \"@typescript-eslint/utils\";\n\nconst meta = {\n name: packageJson.name,\n version: packageJson.version,\n} as const;\n\nconst rules = {\n \"file-kebab-case\": fileKebabCase,\n \"jsx-pascal-case\": jsxPascalCase,\n \"md-filename-case-restriction\": mdFilenameCaseRestriction,\n \"no-emoji\": noEmoji,\n \"no-explicit-return-type\": noExplicitReturnType,\n \"prefer-destructuring-params\": preferDestructuringParams,\n \"prefer-import-type\": preferImportType,\n} as const satisfies Record<string, TSESLint.RuleModule<string, readonly unknown[]>>;\n\nconst plugin = {\n meta,\n rules,\n} as const;\n\nconst baseRules = {\n \"nextfriday/no-emoji\": \"warn\",\n \"nextfriday/file-kebab-case\": \"warn\",\n \"nextfriday/md-filename-case-restriction\": \"warn\",\n \"nextfriday/prefer-destructuring-params\": \"warn\",\n \"nextfriday/no-explicit-return-type\": \"warn\",\n \"nextfriday/prefer-import-type\": \"warn\",\n} as const;\n\nconst baseRecommendedRules = {\n \"nextfriday/no-emoji\": \"error\",\n \"nextfriday/file-kebab-case\": \"error\",\n \"nextfriday/md-filename-case-restriction\": \"error\",\n \"nextfriday/prefer-destructuring-params\": \"error\",\n \"nextfriday/no-explicit-return-type\": \"error\",\n \"nextfriday/prefer-import-type\": \"error\",\n} as const;\n\nconst jsxRules = {\n \"nextfriday/jsx-pascal-case\": \"warn\",\n} as const;\n\nconst jsxRecommendedRules = {\n \"nextfriday/jsx-pascal-case\": \"error\",\n} as const;\n\nconst createConfig = (configRules: Record<string, string>) => ({\n plugins: {\n nextfriday: plugin,\n },\n rules: configRules,\n});\n\nconst configs = {\n base: createConfig(baseRules),\n \"base/recommended\": createConfig(baseRecommendedRules),\n react: createConfig({\n ...baseRules,\n ...jsxRules,\n }),\n \"react/recommended\": createConfig({\n ...baseRecommendedRules,\n ...jsxRecommendedRules,\n }),\n nextjs: createConfig({\n ...baseRules,\n ...jsxRules,\n }),\n \"nextjs/recommended\": createConfig({\n ...baseRecommendedRules,\n ...jsxRecommendedRules,\n }),\n} as const;\n\nconst nextfridayPlugin = {\n meta,\n configs,\n rules,\n} as const;\n\nexport { meta, configs, rules };\n\nexport default nextfridayPlugin;\n"],"mappings":";AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,SAAW;AAAA,EACX,QAAU;AAAA,EACV,cAAgB;AAAA,IACd;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,EACR,SAAW;AAAA,IACT,KAAK;AAAA,MACH,OAAS;AAAA,MACT,QAAU;AAAA,MACV,SAAW;AAAA,IACb;AAAA,EACF;AAAA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","createRule","path","ESLintUtils","createRule","ESLintUtils","createRule","ESLintUtils","createRule","ESLintUtils","createRule","AST_NODE_TYPES","ESLintUtils","createRule"]}
|
package/package.json
CHANGED