@form8ion/eslint-config-extender 8.1.2 → 9.0.0-beta.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/README.md +15 -16
- package/example.js +15 -16
- package/lib/index.mjs +22 -17
- package/lib/index.mjs.map +1 -1
- package/package.json +28 -26
package/README.md
CHANGED
|
@@ -47,8 +47,9 @@ $ 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
|
-
const
|
|
52
|
+
const javascriptPlugin = await import('@form8ion/javascript');
|
|
52
53
|
const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
|
|
53
54
|
```
|
|
54
55
|
|
|
@@ -82,23 +83,21 @@ const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
|
|
|
82
83
|
[projectQuestionNames.GIT_REPO]: true,
|
|
83
84
|
[projectQuestionNames.REPO_HOST]: 'GitHub',
|
|
84
85
|
[projectQuestionNames.REPO_OWNER]: 'org-name',
|
|
85
|
-
[
|
|
86
|
-
[
|
|
87
|
-
[
|
|
88
|
-
[
|
|
89
|
-
[
|
|
90
|
-
[
|
|
91
|
-
[
|
|
92
|
-
[
|
|
86
|
+
[javascriptPlugin.questionNames.AUTHOR_NAME]: 'John Smith',
|
|
87
|
+
[javascriptPlugin.questionNames.AUTHOR_EMAIL]: 'john@smith.org',
|
|
88
|
+
[javascriptPlugin.questionNames.AUTHOR_URL]: 'https://smith.org',
|
|
89
|
+
[javascriptPlugin.questionNames.SCOPE]: 'org-name',
|
|
90
|
+
[javascriptPlugin.questionNames.PACKAGE_MANAGER]: packageManagers.NPM,
|
|
91
|
+
[javascriptPlugin.questionNames.NODE_VERSION_CATEGORY]: 'LTS',
|
|
92
|
+
[javascriptPlugin.questionNames.CI_SERVICE]: 'Other',
|
|
93
|
+
[javascriptPlugin.questionNames.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
|
-
decisions =>
|
|
97
|
+
decisions => ({
|
|
98
|
+
...javascriptPlugin,
|
|
99
|
+
scaffold: options =>javascriptPlugin.scaffold({...options, decisions, unitTestFrameworks: {}})
|
|
100
|
+
})
|
|
102
101
|
);
|
|
103
102
|
})();
|
|
104
103
|
```
|
package/example.js
CHANGED
|
@@ -20,8 +20,9 @@ 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
|
-
const
|
|
25
|
+
const javascriptPlugin = await import('@form8ion/javascript');
|
|
25
26
|
const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
|
|
26
27
|
|
|
27
28
|
// remark-usage-ignore-next
|
|
@@ -54,22 +55,20 @@ stubbedFs({node_modules: stubbedNodeModules});
|
|
|
54
55
|
[projectQuestionNames.GIT_REPO]: true,
|
|
55
56
|
[projectQuestionNames.REPO_HOST]: 'GitHub',
|
|
56
57
|
[projectQuestionNames.REPO_OWNER]: 'org-name',
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
58
|
+
[javascriptPlugin.questionNames.AUTHOR_NAME]: 'John Smith',
|
|
59
|
+
[javascriptPlugin.questionNames.AUTHOR_EMAIL]: 'john@smith.org',
|
|
60
|
+
[javascriptPlugin.questionNames.AUTHOR_URL]: 'https://smith.org',
|
|
61
|
+
[javascriptPlugin.questionNames.SCOPE]: 'org-name',
|
|
62
|
+
[javascriptPlugin.questionNames.PACKAGE_MANAGER]: packageManagers.NPM,
|
|
63
|
+
[javascriptPlugin.questionNames.NODE_VERSION_CATEGORY]: 'LTS',
|
|
64
|
+
[javascriptPlugin.questionNames.CI_SERVICE]: 'Other',
|
|
65
|
+
[javascriptPlugin.questionNames.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
|
-
decisions =>
|
|
69
|
+
decisions => ({
|
|
70
|
+
...javascriptPlugin,
|
|
71
|
+
scaffold: options => javascriptPlugin.scaffold({...options, decisions, unitTestFrameworks: {}})
|
|
72
|
+
})
|
|
74
73
|
);
|
|
75
74
|
})();
|
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`
|
|
@@ -43,7 +46,7 @@ async function scaffold ({projectRoot, scope, projectName}) {
|
|
|
43
46
|
|
|
44
47
|
const PLUGIN_NAME = 'ESLint Config';
|
|
45
48
|
|
|
46
|
-
function highLevel (options,
|
|
49
|
+
function highLevel (options, javascriptPluginFactory) {
|
|
47
50
|
const javaScriptLanguageChoice = 'JavaScript';
|
|
48
51
|
|
|
49
52
|
return scaffold$1(
|
|
@@ -51,17 +54,19 @@ 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]: javascriptPluginFactory({
|
|
60
|
+
...options.decisions,
|
|
61
|
+
[questionNames$1.PROJECT_TYPE]: 'Package',
|
|
62
|
+
[questionNames$1.PROJECT_TYPE_CHOICE]: PLUGIN_NAME,
|
|
63
|
+
[questionNames$1.UNIT_TESTS]: false,
|
|
64
|
+
[questionNames$1.INTEGRATION_TESTS]: false,
|
|
65
|
+
[questionNames$1.CONFIGURE_LINTING]: false,
|
|
66
|
+
[questionNames$1.DIALECT]: dialects.COMMON_JS,
|
|
67
|
+
[questionNames$1.SHOULD_BE_SCOPED]: true
|
|
68
|
+
})
|
|
69
|
+
}
|
|
65
70
|
}
|
|
66
71
|
}
|
|
67
72
|
)
|
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, javascriptPluginFactory) {\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]: javascriptPluginFactory({\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"],"names":["fs","scaffold","projectQuestionNames","jsQuestionNames"],"mappings":";;;;;;;;AAIe,uBAAc,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE;AAClE,EAAE,MAAM,eAAe,GAAG,WAAW,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACzE;AACA,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,CAAC;AACvD,KAAK,CAAC;AACN,IAAIA,QAAE,CAAC,SAAS;AAChB,MAAM,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC;AAC/B,MAAM,CAAC,sCAAsC,EAAE,eAAe,CAAC,KAAK,CAAC;AACrE,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,EA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CAAC,gBAAgB,GAAG,IAAI;AACtD,aAAa,CAAC;AACd,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.2",
|
|
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.9.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.4",
|
|
70
|
+
"@travi/any": "3.1.2",
|
|
71
|
+
"ban-sensitive-files": "1.10.5",
|
|
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.6",
|
|
76
77
|
"gherkin-lint": "4.2.4",
|
|
77
|
-
"husky": "
|
|
78
|
+
"husky": "9.1.5",
|
|
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.3",
|
|
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.5",
|
|
85
|
+
"npm-run-all2": "6.2.2",
|
|
86
|
+
"publint": "0.2.10",
|
|
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.21.1",
|
|
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.5"
|
|
95
|
+
},
|
|
96
|
+
"packageManager": "npm@10.8.2+sha512.c7f0088c520a46596b85c6f8f1da943400199748a0f7ea8cb8df75469668dc26f6fb3ba26df87e2884a5ebe91557292d0f3db7d0929cdb4f14910c3032ac81fb"
|
|
95
97
|
}
|