@form8ion/eslint-config-extender 8.1.2 → 9.0.0-beta.1
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 -6
- package/example.js +2 -6
- package/lib/index.mjs +23 -16
- package/lib/index.mjs.map +1 -1
- package/package.json +28 -26
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ $ npm install @form8ion/eslint-config-extender --save-prod
|
|
|
47
47
|
|
|
48
48
|
```javascript
|
|
49
49
|
const {packageManagers} = await import('@form8ion/javascript-core');
|
|
50
|
+
const githubPlugin = await import('@form8ion/github');
|
|
50
51
|
const {questionNames: projectQuestionNames} = await import('@form8ion/project');
|
|
51
52
|
const {scaffold: javascriptScaffolder, questionNames: jsQuestionNames} = await import('@form8ion/javascript');
|
|
52
53
|
const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
|
|
@@ -91,12 +92,7 @@ const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
|
|
|
91
92
|
[jsQuestionNames.CI_SERVICE]: 'Other',
|
|
92
93
|
[jsQuestionNames.PROVIDE_EXAMPLE]: false
|
|
93
94
|
},
|
|
94
|
-
vcsHosts: {
|
|
95
|
-
GitHub: {
|
|
96
|
-
scaffolder: options => options,
|
|
97
|
-
prompt: ({decisions}) => ({[projectQuestionNames.REPO_OWNER]: decisions[projectQuestionNames.REPO_OWNER]})
|
|
98
|
-
}
|
|
99
|
-
}
|
|
95
|
+
plugins: {vcsHosts: {GitHub: githubPlugin}}
|
|
100
96
|
},
|
|
101
97
|
decisions => options => javascriptScaffolder({...options, decisions, unitTestFrameworks: {}})
|
|
102
98
|
);
|
package/example.js
CHANGED
|
@@ -20,6 +20,7 @@ td.when(execa('npm run generate:md && npm test', {shell: true})).thenReturn({std
|
|
|
20
20
|
td.when(execa('npm', ['whoami'])).thenResolve({stdout: any.word()});
|
|
21
21
|
|
|
22
22
|
const {packageManagers} = await import('@form8ion/javascript-core');
|
|
23
|
+
const githubPlugin = await import('@form8ion/github');
|
|
23
24
|
const {questionNames: projectQuestionNames} = await import('@form8ion/project');
|
|
24
25
|
const {scaffold: javascriptScaffolder, questionNames: jsQuestionNames} = await import('@form8ion/javascript');
|
|
25
26
|
const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
|
|
@@ -63,12 +64,7 @@ stubbedFs({node_modules: stubbedNodeModules});
|
|
|
63
64
|
[jsQuestionNames.CI_SERVICE]: 'Other',
|
|
64
65
|
[jsQuestionNames.PROVIDE_EXAMPLE]: false
|
|
65
66
|
},
|
|
66
|
-
vcsHosts: {
|
|
67
|
-
GitHub: {
|
|
68
|
-
scaffolder: options => options,
|
|
69
|
-
prompt: ({decisions}) => ({[projectQuestionNames.REPO_OWNER]: decisions[projectQuestionNames.REPO_OWNER]})
|
|
70
|
-
}
|
|
71
|
-
}
|
|
67
|
+
plugins: {vcsHosts: {GitHub: githubPlugin}}
|
|
72
68
|
},
|
|
73
69
|
decisions => options => javascriptScaffolder({...options, decisions, unitTestFrameworks: {}})
|
|
74
70
|
);
|
package/lib/index.mjs
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { promises } from 'node:fs';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { fileTypes } from '@form8ion/core';
|
|
3
|
+
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
7
|
import { scaffold as scaffold$1, questionNames } from '@form8ion/project';
|
|
8
8
|
|
|
9
|
-
var writeYaml = promisify(yaml);
|
|
10
|
-
|
|
11
9
|
async function scaffold ({projectRoot, scope, projectName}) {
|
|
12
10
|
const configShortName = projectName.substring('eslint-config-'.length);
|
|
13
11
|
|
|
14
12
|
await Promise.all([
|
|
15
|
-
|
|
13
|
+
write({
|
|
14
|
+
format: fileTypes.YAML,
|
|
15
|
+
path: projectRoot,
|
|
16
|
+
name: 'eslint',
|
|
17
|
+
config: {root: true, extends: [`@${scope}`, '.']}
|
|
18
|
+
}),
|
|
16
19
|
promises.writeFile(
|
|
17
20
|
`${projectRoot}/index.js`,
|
|
18
21
|
`module.exports = {extends: '@form8ion/${configShortName}'};\n`
|
|
@@ -51,17 +54,21 @@ function highLevel (options, javascriptScaffolderFactory) {
|
|
|
51
54
|
options,
|
|
52
55
|
{
|
|
53
56
|
decisions: {[questionNames.PROJECT_LANGUAGE]: javaScriptLanguageChoice},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
plugins: {
|
|
58
|
+
languages: {
|
|
59
|
+
[javaScriptLanguageChoice]: {
|
|
60
|
+
scaffold: javascriptScaffolderFactory({
|
|
61
|
+
...options.decisions,
|
|
62
|
+
[questionNames$1.PROJECT_TYPE]: 'Package',
|
|
63
|
+
[questionNames$1.PROJECT_TYPE_CHOICE]: PLUGIN_NAME,
|
|
64
|
+
[questionNames$1.UNIT_TESTS]: false,
|
|
65
|
+
[questionNames$1.INTEGRATION_TESTS]: false,
|
|
66
|
+
[questionNames$1.CONFIGURE_LINTING]: false,
|
|
67
|
+
[questionNames$1.DIALECT]: dialects.COMMON_JS,
|
|
68
|
+
[questionNames$1.SHOULD_BE_SCOPED]: true
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
}
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
74
|
)
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/scaffold.js","../src/constants.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: [`@form8ion/${projectName}`],\n devDependencies: [`@${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';\n","import deepmerge from 'deepmerge';\nimport {questionNames as jsQuestionNames} from '@form8ion/javascript';\nimport {dialects} from '@form8ion/javascript-core';\nimport {questionNames as projectQuestionNames, scaffold} from '@form8ion/project';\n\nimport {PLUGIN_NAME} from './constants.js';\n\nexport default function (options, javascriptScaffolderFactory) {\n const javaScriptLanguageChoice = 'JavaScript';\n\n return scaffold(\n deepmerge(\n options,\n {\n decisions: {[projectQuestionNames.PROJECT_LANGUAGE]: javaScriptLanguageChoice},\n plugins: {\n languages: {\n [javaScriptLanguageChoice]: {\n scaffold: javascriptScaffolderFactory({\n ...options.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 );\n}\n"],"names":["fs","scaffold","projectQu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AAC;AACjE,MAAM,CAAC,OAAO,EAAE,uDAAuD,CAAC;AACxE,KAAK;AACL,GAAG,CAAC;AACJ;;ACxCY,MAAC,WAAW,GAAG;;ACOZ,kBAAQ,EAAE,OAAO,EAAE,2BAA2B,EAAE;AAC/D,EAAE,MAAM,wBAAwB,GAAG,YAAY,CAAC;AAChD;AACA,EAAE,OAAOC,UAAQ;AACjB,IAAI,SAAS;AACb,MAAM,OAAO;AACb,MAAM;AACN,QAAQ,SAAS,EAAE,CAAC,CAACC,aAAoB,CAAC,gBAAgB,GAAG,wBAAwB,CAAC;AACtF,QAAQ,OAAO,EAAE;AACjB,UAAU,SAAS,EAAE;AACrB,YAAY,CAAC,wBAAwB,GAAG;AACxC,cAAc,QAAQ,EAAE,2BAA2B,CAAC;AACpD,gBAAgB,GAAG,OAAO,CAAC,SAAS;AACpC,gBAAgB,CAACC,eAAe,CAAC,YAAY,GAAG,SAAS;AACzD,gBAAgB,CAACA,eAAe,CAAC,mBAAmB,GAAG,WAAW;AAClE,gBAAgB,CAACA,eAAe,CAAC,UAAU,GAAG,KAAK;AACnD,gBAAgB,CAACA,eAAe,CAAC,iBAAiB,GAAG,KAAK;AAC1D,gBAAgB,CAACA,eAAe,CAAC,iBAAiB,GAAG,KAAK;AAC1D,gBAAgB,CAACA,eAAe,CAAC,OAAO,GAAG,QAAQ,CAAC,SAAS;AAC7D,gBAAgB,CAACA,eAAe,CAAC,gBAAgB,GAAG,IAAI;AACxD,eAAe,CAAC;AAChB,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@form8ion/eslint-config-extender",
|
|
3
3
|
"description": "shareable ESLint config scaffolder for extending another config",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "9.0.0-beta.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": "^18.17.0 || >=20.6.1"
|
|
@@ -53,43 +53,45 @@
|
|
|
53
53
|
"provenance": true
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
+
"@form8ion/config-file": "^1.1.2",
|
|
57
|
+
"@form8ion/core": "^4.7.1",
|
|
56
58
|
"@form8ion/javascript": "^12.0.0",
|
|
57
59
|
"@form8ion/javascript-core": "^11.0.0",
|
|
58
|
-
"@form8ion/project": "^
|
|
59
|
-
"deepmerge": "^4.2.2"
|
|
60
|
-
"write-yaml": "^1.0.0"
|
|
60
|
+
"@form8ion/project": "^19.0.1",
|
|
61
|
+
"deepmerge": "^4.2.2"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
|
-
"@cucumber/cucumber": "10.
|
|
64
|
-
"@form8ion/commitlint-config": "1.0.
|
|
65
|
-
"@form8ion/eslint-config": "7.0.
|
|
64
|
+
"@cucumber/cucumber": "10.8.0",
|
|
65
|
+
"@form8ion/commitlint-config": "1.0.76",
|
|
66
|
+
"@form8ion/eslint-config": "7.0.9",
|
|
66
67
|
"@form8ion/eslint-config-cucumber": "1.4.1",
|
|
67
|
-
"@form8ion/
|
|
68
|
-
"@
|
|
69
|
-
"@travi/
|
|
70
|
-
"ban-sensitive-files": "1.10.
|
|
71
|
-
"c8": "
|
|
72
|
-
"chai": "5.
|
|
68
|
+
"@form8ion/github": "2.0.0",
|
|
69
|
+
"@form8ion/remark-lint-preset": "6.0.3",
|
|
70
|
+
"@travi/any": "3.1.2",
|
|
71
|
+
"ban-sensitive-files": "1.10.4",
|
|
72
|
+
"c8": "10.1.2",
|
|
73
|
+
"chai": "5.1.1",
|
|
73
74
|
"cross-env": "7.0.3",
|
|
74
75
|
"cz-conventional-changelog": "3.3.0",
|
|
75
|
-
"debug": "4.3.
|
|
76
|
+
"debug": "4.3.5",
|
|
76
77
|
"gherkin-lint": "4.2.4",
|
|
77
|
-
"husky": "
|
|
78
|
+
"husky": "9.1.1",
|
|
78
79
|
"jest-when": "3.6.0",
|
|
79
80
|
"js-yaml": "4.1.0",
|
|
80
|
-
"lockfile-lint": "4.
|
|
81
|
-
"ls-engines": "0.9.
|
|
81
|
+
"lockfile-lint": "4.14.0",
|
|
82
|
+
"ls-engines": "0.9.2",
|
|
82
83
|
"mock-fs": "5.2.0",
|
|
83
|
-
"nock": "13.5.
|
|
84
|
-
"npm-run-all2": "6.
|
|
85
|
-
"publint": "0.2.
|
|
86
|
-
"remark-cli": "12.0.
|
|
84
|
+
"nock": "13.5.4",
|
|
85
|
+
"npm-run-all2": "6.2.2",
|
|
86
|
+
"publint": "0.2.9",
|
|
87
|
+
"remark-cli": "12.0.1",
|
|
87
88
|
"remark-toc": "9.0.0",
|
|
88
89
|
"remark-usage": "11.0.1",
|
|
89
|
-
"rimraf": "
|
|
90
|
-
"rollup": "4.
|
|
90
|
+
"rimraf": "6.0.1",
|
|
91
|
+
"rollup": "4.19.0",
|
|
91
92
|
"rollup-plugin-auto-external": "2.0.0",
|
|
92
|
-
"testdouble": "3.20.
|
|
93
|
-
"vitest": "
|
|
94
|
-
}
|
|
93
|
+
"testdouble": "3.20.2",
|
|
94
|
+
"vitest": "2.0.4"
|
|
95
|
+
},
|
|
96
|
+
"packageManager": "npm@10.8.2+sha512.c7f0088c520a46596b85c6f8f1da943400199748a0f7ea8cb8df75469668dc26f6fb3ba26df87e2884a5ebe91557292d0f3db7d0929cdb4f14910c3032ac81fb"
|
|
95
97
|
}
|