@form8ion/eslint-config-extender 12.0.0-beta.2 → 12.0.0-beta.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/README.md +2 -2
- package/lib/index.mjs +4 -4
- package/lib/index.mjs.map +1 -1
- package/package.json +20 -22
- package/src/scaffold.js +1 -1
package/README.md
CHANGED
|
@@ -179,11 +179,11 @@ $ npm test
|
|
|
179
179
|
|
|
180
180
|
[renovate-link]: https://renovatebot.com
|
|
181
181
|
|
|
182
|
-
[renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen.svg?logo=
|
|
182
|
+
[renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen.svg?logo=renovate
|
|
183
183
|
|
|
184
184
|
[coverage-link]: https://codecov.io/github/form8ion/eslint-config-extender
|
|
185
185
|
|
|
186
|
-
[coverage-badge]: https://img.shields.io/codecov/c/github/form8ion/eslint-config-extender?logo=codecov
|
|
186
|
+
[coverage-badge]: https://img.shields.io/codecov/c/github/form8ion/eslint-config-extender/master?logo=codecov
|
|
187
187
|
|
|
188
188
|
[license-link]: LICENSE
|
|
189
189
|
|
package/lib/index.mjs
CHANGED
|
@@ -4,9 +4,9 @@ import { write } from '@form8ion/config-file';
|
|
|
4
4
|
import deepmerge from 'deepmerge';
|
|
5
5
|
import { questionNames as questionNames$1 } from '@form8ion/javascript';
|
|
6
6
|
import { dialects } from '@form8ion/javascript-core';
|
|
7
|
-
import { promptConstants, questionNames, scaffold
|
|
7
|
+
import { promptConstants, questionNames, scaffold } from '@form8ion/project';
|
|
8
8
|
|
|
9
|
-
async function
|
|
9
|
+
async function scaffoldEslintConfig({projectRoot, scope, projectName}) {
|
|
10
10
|
const configShortName = projectName.substring('eslint-config-'.length);
|
|
11
11
|
|
|
12
12
|
await Promise.all([
|
|
@@ -60,7 +60,7 @@ function injectLanguageChoiceIntoPrompt(prompt) {
|
|
|
60
60
|
function extendEslintConfig(options, javascriptPluginFactory, dependencies) {
|
|
61
61
|
const {decisions, ...otherOptions} = options;
|
|
62
62
|
|
|
63
|
-
return scaffold
|
|
63
|
+
return scaffold(
|
|
64
64
|
deepmerge(
|
|
65
65
|
otherOptions,
|
|
66
66
|
{
|
|
@@ -87,5 +87,5 @@ function extendEslintConfig(options, javascriptPluginFactory, dependencies) {
|
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export { PLUGIN_NAME, extendEslintConfig, scaffold };
|
|
90
|
+
export { PLUGIN_NAME, extendEslintConfig, scaffoldEslintConfig as scaffold };
|
|
91
91
|
//# sourceMappingURL=index.mjs.map
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/scaffold.js","../src/constants.js","../src/language-handler-prompt.js","../src/high-level.js"],"sourcesContent":["import {promises as fs} from 'node:fs';\nimport {fileTypes} from '@form8ion/core';\nimport {write} from '@form8ion/config-file';\n\nexport default async function ({projectRoot, scope, projectName}) {\n const configShortName = projectName.substring('eslint-config-'.length);\n\n await Promise.all([\n write({\n format: fileTypes.YAML,\n path: projectRoot,\n name: 'eslint',\n config: {root: true, extends: [`@${scope}`, '.']}\n }),\n fs.writeFile(\n `${projectRoot}/index.js`,\n `module.exports = {extends: '@form8ion/${configShortName}'};\\n`\n ),\n fs.writeFile(\n `${projectRoot}/example.js`,\n `module.exports = {\n extends: [\n '@${scope}',\n '@${scope}/${configShortName}'\n ]\n};\n`\n )\n ]);\n\n return {\n scripts: {'lint:js': 'eslint .'},\n dependencies: {javascript: {production: [`@form8ion/${projectName}`], development: [`@${scope}/eslint-config`]}},\n nextSteps: [\n {summary: 'Save the extended `@form8ion` eslint-config as an exact version'},\n {summary: 'Document saving this config using the dev flag'},\n {summary: 'Link to the extended `@form8ion` config in the README'}\n ]\n };\n}\n","export const PLUGIN_NAME = 'ESLint Config';\nexport const JAVASCRIPT_LANGUAGE_CHOICE = 'JavaScript';\n","import {promptConstants, questionNames as projectQuestionNames} from '@form8ion/project';\nimport {JAVASCRIPT_LANGUAGE_CHOICE} from './constants.js';\n\nexport default function injectLanguageChoiceIntoPrompt(prompt) {\n return promptOptions => {\n const {id} = promptOptions;\n\n if (promptConstants.ids.PROJECT_LANGUAGE === id) {\n return {[projectQuestionNames.PROJECT_LANGUAGE]: JAVASCRIPT_LANGUAGE_CHOICE};\n }\n return prompt(promptOptions);\n };\n}\n","import deepmerge from 'deepmerge';\nimport {questionNames as jsQuestionNames} from '@form8ion/javascript';\nimport {dialects} from '@form8ion/javascript-core';\nimport {scaffold} from '@form8ion/project';\n\nimport {JAVASCRIPT_LANGUAGE_CHOICE, PLUGIN_NAME} from './constants.js';\nimport injectLanguageChoiceIntoPrompt from './language-handler-prompt.js';\n\nexport default function extendEslintConfig(options, javascriptPluginFactory, dependencies) {\n const {decisions, ...otherOptions} = options;\n\n return scaffold(\n deepmerge(\n otherOptions,\n {\n plugins: {\n languages: {\n [JAVASCRIPT_LANGUAGE_CHOICE]: javascriptPluginFactory({\n ...decisions,\n [jsQuestionNames.PROJECT_TYPE]: 'Package',\n [jsQuestionNames.PROJECT_TYPE_CHOICE]: PLUGIN_NAME,\n [jsQuestionNames.UNIT_TESTS]: false,\n [jsQuestionNames.INTEGRATION_TESTS]: false,\n [jsQuestionNames.CONFIGURE_LINTING]: false,\n [jsQuestionNames.DIALECT]: dialects.COMMON_JS,\n [jsQuestionNames.SHOULD_BE_SCOPED]: true\n })\n }\n }\n }\n ),\n {\n ...dependencies,\n prompt: injectLanguageChoiceIntoPrompt(dependencies.prompt)\n }\n );\n}\n"],"names":["fs","projectQuestionNames","
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/scaffold.js","../src/constants.js","../src/language-handler-prompt.js","../src/high-level.js"],"sourcesContent":["import {promises as fs} from 'node:fs';\nimport {fileTypes} from '@form8ion/core';\nimport {write} from '@form8ion/config-file';\n\nexport default async function scaffoldEslintConfig({projectRoot, scope, projectName}) {\n const configShortName = projectName.substring('eslint-config-'.length);\n\n await Promise.all([\n write({\n format: fileTypes.YAML,\n path: projectRoot,\n name: 'eslint',\n config: {root: true, extends: [`@${scope}`, '.']}\n }),\n fs.writeFile(\n `${projectRoot}/index.js`,\n `module.exports = {extends: '@form8ion/${configShortName}'};\\n`\n ),\n fs.writeFile(\n `${projectRoot}/example.js`,\n `module.exports = {\n extends: [\n '@${scope}',\n '@${scope}/${configShortName}'\n ]\n};\n`\n )\n ]);\n\n return {\n scripts: {'lint:js': 'eslint .'},\n dependencies: {javascript: {production: [`@form8ion/${projectName}`], development: [`@${scope}/eslint-config`]}},\n nextSteps: [\n {summary: 'Save the extended `@form8ion` eslint-config as an exact version'},\n {summary: 'Document saving this config using the dev flag'},\n {summary: 'Link to the extended `@form8ion` config in the README'}\n ]\n };\n}\n","export const PLUGIN_NAME = 'ESLint Config';\nexport const JAVASCRIPT_LANGUAGE_CHOICE = 'JavaScript';\n","import {promptConstants, questionNames as projectQuestionNames} from '@form8ion/project';\nimport {JAVASCRIPT_LANGUAGE_CHOICE} from './constants.js';\n\nexport default function injectLanguageChoiceIntoPrompt(prompt) {\n return promptOptions => {\n const {id} = promptOptions;\n\n if (promptConstants.ids.PROJECT_LANGUAGE === id) {\n return {[projectQuestionNames.PROJECT_LANGUAGE]: JAVASCRIPT_LANGUAGE_CHOICE};\n }\n return prompt(promptOptions);\n };\n}\n","import deepmerge from 'deepmerge';\nimport {questionNames as jsQuestionNames} from '@form8ion/javascript';\nimport {dialects} from '@form8ion/javascript-core';\nimport {scaffold} from '@form8ion/project';\n\nimport {JAVASCRIPT_LANGUAGE_CHOICE, PLUGIN_NAME} from './constants.js';\nimport injectLanguageChoiceIntoPrompt from './language-handler-prompt.js';\n\nexport default function extendEslintConfig(options, javascriptPluginFactory, dependencies) {\n const {decisions, ...otherOptions} = options;\n\n return scaffold(\n deepmerge(\n otherOptions,\n {\n plugins: {\n languages: {\n [JAVASCRIPT_LANGUAGE_CHOICE]: javascriptPluginFactory({\n ...decisions,\n [jsQuestionNames.PROJECT_TYPE]: 'Package',\n [jsQuestionNames.PROJECT_TYPE_CHOICE]: PLUGIN_NAME,\n [jsQuestionNames.UNIT_TESTS]: false,\n [jsQuestionNames.INTEGRATION_TESTS]: false,\n [jsQuestionNames.CONFIGURE_LINTING]: false,\n [jsQuestionNames.DIALECT]: dialects.COMMON_JS,\n [jsQuestionNames.SHOULD_BE_SCOPED]: true\n })\n }\n }\n }\n ),\n {\n ...dependencies,\n prompt: injectLanguageChoiceIntoPrompt(dependencies.prompt)\n }\n );\n}\n"],"names":["fs","projectQuestionNames","jsQuestionNames"],"mappings":";;;;;;;;AAIe,eAAe,oBAAoB,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE;AACtF,EAAE,MAAM,eAAe,GAAG,WAAW,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC;;AAExE,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;AACpB,IAAI,KAAK,CAAC;AACV,MAAM,MAAM,EAAE,SAAS,CAAC,IAAI;AAC5B,MAAM,IAAI,EAAE,WAAW;AACvB,MAAM,IAAI,EAAE,QAAQ;AACpB,MAAM,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;AACtD,KAAK,CAAC;AACN,IAAIA,QAAE,CAAC,SAAS;AAChB,MAAM,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC;AAC/B,MAAM,CAAC,sCAAsC,EAAE,eAAe,CAAC,KAAK;AACpE,KAAK;AACL,IAAIA,QAAE,CAAC,SAAS;AAChB,MAAM,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC;AACjC,MAAM,CAAC;AACP;AACA,MAAM,EAAE,KAAK,CAAC;AACd,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC;AACjC;AACA;AACA;AACA;AACA,GAAG,CAAC;;AAEJ,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AAC,mBAAmB,GAAG,WAAW;AAChE,cAAc,CAACA,eAAe,CAAC,UAAU,GAAG,KAAK;AACjD,cAAc,CAACA,eAAe,CAAC,iBAAiB,GAAG,KAAK;AACxD,cAAc,CAACA,eAAe,CAAC,iBAAiB,GAAG,KAAK;AACxD,cAAc,CAACA,eAAe,CAAC,OAAO,GAAG,QAAQ,CAAC,SAAS;AAC3D,cAAc,CAACA,eAAe,CAAC,gBAAgB,GAAG;AAClD,aAAa;AACb;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ,MAAM,GAAG,YAAY;AACrB,MAAM,MAAM,EAAE,8BAA8B,CAAC,YAAY,CAAC,MAAM;AAChE;AACA,GAAG;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"name": "@form8ion/eslint-config-extender",
|
|
3
3
|
"description": "shareable ESLint config scaffolder for extending another config",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "12.0.0-beta.
|
|
5
|
+
"version": "12.0.0-beta.3",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "^
|
|
8
|
+
"node": "^22.21.0 || >=24.12"
|
|
9
9
|
},
|
|
10
10
|
"author": "Matt Travi <npm@travi.org> (https://matt.travi.org)",
|
|
11
11
|
"repository": "form8ion/eslint-config-extender",
|
|
12
12
|
"bugs": "https://github.com/form8ion/eslint-config-extender/issues",
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://www.npmjs.com/package/@form8ion/eslint-config-extender",
|
|
14
14
|
"runkitExampleFilename": "./example.js",
|
|
15
15
|
"exports": "./lib/index.mjs",
|
|
16
16
|
"main": "lib/index.mjs",
|
|
@@ -18,33 +18,32 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"pretest": "run-s build",
|
|
20
20
|
"test": "npm-run-all --print-label --parallel lint:* --parallel test:*",
|
|
21
|
-
"lint:
|
|
21
|
+
"lint:engines": "ls-engines",
|
|
22
|
+
"lint:gherkin": "gplint --config .gplintrc.json",
|
|
22
23
|
"lint:js": "eslint . --cache",
|
|
24
|
+
"lint:js:fix": "run-s 'lint:js -- --fix'",
|
|
25
|
+
"lint:lockfile": "lockfile-lint",
|
|
23
26
|
"lint:md": "remark . --frail",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
27
|
+
"lint:peer": "npm ls >/dev/null",
|
|
28
|
+
"lint:publish": "publint --strict",
|
|
26
29
|
"lint:sensitive": "ban",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
30
|
+
"test:unit": "run-s 'test:unit:base -- --coverage'",
|
|
31
|
+
"test:unit:base": "NODE_ENV=test DEBUG=any vitest run src/",
|
|
29
32
|
"test:integration": "run-s 'test:integration:base -- --profile noWip'",
|
|
33
|
+
"pretest:integration:base": "run-s build",
|
|
30
34
|
"test:integration:base": "NODE_OPTIONS=--enable-source-maps DEBUG=any cucumber-js test/integration",
|
|
31
35
|
"test:integration:debug": "DEBUG=test:* run-s test:integration",
|
|
32
36
|
"test:integration:wip": "run-s 'test:integration:base -- --profile wip'",
|
|
33
37
|
"test:integration:wip:debug": "DEBUG=test run-s 'test:integration:wip'",
|
|
34
|
-
"test:integration:focus": "run-s 'test:integration:base -- --profile focus'",
|
|
35
|
-
"clean": "rimraf ./lib",
|
|
36
38
|
"prebuild": "run-s clean",
|
|
37
39
|
"build": "npm-run-all --print-label --parallel build:*",
|
|
38
40
|
"build:js": "rollup --config",
|
|
39
|
-
"
|
|
41
|
+
"clean": "rimraf ./lib",
|
|
42
|
+
"pregenerate:md": "run-s build",
|
|
43
|
+
"generate:md": "NODE_OPTIONS=--enable-source-maps remark . --output",
|
|
40
44
|
"prepack": "run-s build",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"lint:peer": "npm ls >/dev/null",
|
|
44
|
-
"prepare": "husky install",
|
|
45
|
-
"lint:engines": "ls-engines",
|
|
46
|
-
"lint:publish": "publint --strict",
|
|
47
|
-
"lint:js:fix": "run-s 'lint:js -- --fix'"
|
|
45
|
+
"prepare": "husky",
|
|
46
|
+
"watch": "run-s 'build:js -- --watch'"
|
|
48
47
|
},
|
|
49
48
|
"files": [
|
|
50
49
|
"example.js",
|
|
@@ -67,18 +66,17 @@
|
|
|
67
66
|
"devDependencies": {
|
|
68
67
|
"@cucumber/cucumber": "12.8.2",
|
|
69
68
|
"@form8ion/commitlint-config": "2.0.13",
|
|
70
|
-
"@form8ion/eslint-config": "7.0.
|
|
69
|
+
"@form8ion/eslint-config": "7.1.0-beta.1",
|
|
71
70
|
"@form8ion/eslint-config-cucumber": "1.4.1",
|
|
72
71
|
"@form8ion/eslint-config-vitest": "1.1.0",
|
|
73
72
|
"@form8ion/remark-lint-preset": "6.0.7",
|
|
74
73
|
"@travi/any": "3.3.0",
|
|
74
|
+
"@vitest/coverage-v8": "4.1.5",
|
|
75
75
|
"ban-sensitive-files": "1.10.11",
|
|
76
|
-
"c8": "11.0.0",
|
|
77
76
|
"chai": "6.2.2",
|
|
78
|
-
"cross-env": "10.1.0",
|
|
79
77
|
"cz-conventional-changelog": "3.3.0",
|
|
80
78
|
"debug": "4.4.3",
|
|
81
|
-
"
|
|
79
|
+
"gplint": "2.5.2",
|
|
82
80
|
"husky": "9.1.7",
|
|
83
81
|
"js-yaml": "4.1.1",
|
|
84
82
|
"lockfile-lint": "5.0.0",
|
package/src/scaffold.js
CHANGED
|
@@ -2,7 +2,7 @@ import {promises as fs} from 'node:fs';
|
|
|
2
2
|
import {fileTypes} from '@form8ion/core';
|
|
3
3
|
import {write} from '@form8ion/config-file';
|
|
4
4
|
|
|
5
|
-
export default async function ({projectRoot, scope, projectName}) {
|
|
5
|
+
export default async function scaffoldEslintConfig({projectRoot, scope, projectName}) {
|
|
6
6
|
const configShortName = projectName.substring('eslint-config-'.length);
|
|
7
7
|
|
|
8
8
|
await Promise.all([
|