@form8ion/eslint-config-extender 6.1.0 → 7.0.0
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 +4 -4
- package/example.js +7 -7
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/package.json +19 -25
- package/lib/index.js +0 -76
- package/lib/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -45,10 +45,10 @@ $ npm install @form8ion/eslint-config-extender --save-prod
|
|
|
45
45
|
#### Import
|
|
46
46
|
|
|
47
47
|
```javascript
|
|
48
|
-
const {packageManagers} =
|
|
49
|
-
const {questionNames: projectQuestionNames} =
|
|
50
|
-
const {scaffold: javascriptScaffolder, questionNames: jsQuestionNames} =
|
|
51
|
-
const {scaffold, extendEslintConfig} =
|
|
48
|
+
const {packageManagers} = await import('@form8ion/javascript-core');
|
|
49
|
+
const {questionNames: projectQuestionNames} = await import('@form8ion/project');
|
|
50
|
+
const {scaffold: javascriptScaffolder, questionNames: jsQuestionNames} = await import('@form8ion/javascript');
|
|
51
|
+
const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
#### Execute
|
package/example.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// #### Import
|
|
2
2
|
// remark-usage-ignore-next 4
|
|
3
|
-
import {resolve} from 'path';
|
|
3
|
+
import {resolve} from 'node:path';
|
|
4
4
|
import stubbedFs from 'mock-fs';
|
|
5
|
-
import td from 'testdouble';
|
|
5
|
+
import * as td from 'testdouble';
|
|
6
6
|
import any from '@travi/any';
|
|
7
7
|
|
|
8
8
|
// remark-usage-ignore-next 12
|
|
@@ -11,7 +11,7 @@ const error = new Error('Command failed with exit code 1: npm ls husky --json');
|
|
|
11
11
|
error.exitCode = 1;
|
|
12
12
|
error.stdout = JSON.stringify({});
|
|
13
13
|
error.command = 'npm ls husky --json';
|
|
14
|
-
const execa = td.
|
|
14
|
+
const {default: execa} = await td.replaceEsm('@form8ion/execa-wrapper');
|
|
15
15
|
td.when(execa('. ~/.nvm/nvm.sh && nvm ls-remote --lts', {shell: true}))
|
|
16
16
|
.thenResolve({stdout: ['v16.5.4', ''].join('\n')});
|
|
17
17
|
td.when(execa('. ~/.nvm/nvm.sh && nvm install', {shell: true})).thenReturn({stdout: {pipe: () => undefined}});
|
|
@@ -19,10 +19,10 @@ td.when(execa('npm', ['ls', 'husky', '--json'])).thenReject(error);
|
|
|
19
19
|
td.when(execa('npm run generate:md && npm test', {shell: true})).thenReturn({stdout: {pipe: () => undefined}});
|
|
20
20
|
td.when(execa('npm', ['whoami'])).thenResolve({stdout: any.word()});
|
|
21
21
|
|
|
22
|
-
const {packageManagers} =
|
|
23
|
-
const {questionNames: projectQuestionNames} =
|
|
24
|
-
const {scaffold: javascriptScaffolder, questionNames: jsQuestionNames} =
|
|
25
|
-
const {scaffold, extendEslintConfig} =
|
|
22
|
+
const {packageManagers} = await import('@form8ion/javascript-core');
|
|
23
|
+
const {questionNames: projectQuestionNames} = await import('@form8ion/project');
|
|
24
|
+
const {scaffold: javascriptScaffolder, questionNames: jsQuestionNames} = await import('@form8ion/javascript');
|
|
25
|
+
const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
|
|
26
26
|
|
|
27
27
|
// remark-usage-ignore-next
|
|
28
28
|
stubbedFs({node_modules: stubbedNodeModules});
|
package/lib/index.mjs
CHANGED
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../thirdparty-wrappers/write-yaml.js","../src/scaffold.js","../src/constants.js","../src/high-level.js"],"sourcesContent":["import {promisify} from 'util';\nimport yaml from 'write-yaml';\n\nexport default promisify(yaml);\n","import {promises as fs} from 'fs';\nimport writeYaml from '../thirdparty-wrappers/write-yaml';\n\nexport default async function ({projectRoot, scope, projectName}) {\n const configShortName = projectName.substring('eslint-config-'.length);\n\n await Promise.all([\n writeYaml(`${projectRoot}/.eslintrc.yml`, {root: true, extends: [`@${scope}`, '.']}),\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 {scaffold, questionNames as projectQuestionNames} from '@form8ion/project';\nimport {PLUGIN_NAME} from './constants';\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 languages: {\n [javaScriptLanguageChoice]: 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"],"names":["fs","scaffold","projectQuestionNames","jsQuestionNames"],"mappings":";;;;;;;;AAGA,gBAAe,SAAS,CAAC,IAAI,CAAC;;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../thirdparty-wrappers/write-yaml.js","../src/scaffold.js","../src/constants.js","../src/high-level.js"],"sourcesContent":["import {promisify} from 'util';\nimport yaml from 'write-yaml';\n\nexport default promisify(yaml);\n","import {promises as fs} from 'node:fs';\n\nimport writeYaml from '../thirdparty-wrappers/write-yaml.js';\n\nexport default async function ({projectRoot, scope, projectName}) {\n const configShortName = projectName.substring('eslint-config-'.length);\n\n await Promise.all([\n writeYaml(`${projectRoot}/.eslintrc.yml`, {root: true, extends: [`@${scope}`, '.']}),\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 {scaffold, questionNames as projectQuestionNames} 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 languages: {\n [javaScriptLanguageChoice]: 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"],"names":["fs","scaffold","projectQuestionNames","jsQuestionNames"],"mappings":";;;;;;;;AAGA,gBAAe,SAAS,CAAC,IAAI,CAAC;;ACCf,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,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACxF,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,EAAE,eAAe,CAAC;AACjC;AACA;AACA,CAAC;AACD,KAAK;AACL,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO;AACT,IAAI,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;AACpC,IAAI,YAAY,EAAE,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;AAC9C,IAAI,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;AAChD,IAAI,SAAS,EAAE;AACf,MAAM,CAAC,OAAO,EAAE,iEAAiE,CAAC;AAClF,MAAM,CAAC,OAAO,EAAE,gDAAgD,CAAC;AACjE,MAAM,CAAC,OAAO,EAAE,uDAAuD,CAAC;AACxE,KAAK;AACL,GAAG,CAAC;AACJ;;ACnCY,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,SAAS,EAAE;AACnB,UAAU,CAAC,wBAAwB,GAAG,2BAA2B,CAAC;AAClE,YAAY,GAAG,OAAO,CAAC,SAAS;AAChC,YAAY,CAACC,eAAe,CAAC,YAAY,GAAG,SAAS;AACrD,YAAY,CAACA,eAAe,CAAC,mBAAmB,GAAG,WAAW;AAC9D,YAAY,CAACA,eAAe,CAAC,UAAU,GAAG,KAAK;AAC/C,YAAY,CAACA,eAAe,CAAC,iBAAiB,GAAG,KAAK;AACtD,YAAY,CAACA,eAAe,CAAC,iBAAiB,GAAG,KAAK;AACtD,YAAY,CAACA,eAAe,CAAC,OAAO,GAAG,QAAQ,CAAC,SAAS;AACzD,YAAY,CAACA,eAAe,CAAC,gBAAgB,GAAG,IAAI;AACpD,WAAW,CAAC;AACZ,SAAS;AACT,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
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": "7.0.0",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"engines": {
|
|
7
8
|
"node": "^16.13.0 || >=18"
|
|
8
9
|
},
|
|
@@ -11,25 +12,21 @@
|
|
|
11
12
|
"bugs": "https://github.com/form8ion/eslint-config-extender/issues",
|
|
12
13
|
"homepage": "https://npm.im/@form8ion/eslint-config-extender",
|
|
13
14
|
"runkitExampleFilename": "./example.js",
|
|
14
|
-
"exports":
|
|
15
|
-
|
|
16
|
-
"import": "./lib/index.mjs"
|
|
17
|
-
},
|
|
18
|
-
"main": "lib/index.js",
|
|
19
|
-
"module": "lib/index.mjs",
|
|
15
|
+
"exports": "./lib/index.mjs",
|
|
16
|
+
"main": "lib/index.mjs",
|
|
20
17
|
"sideEffects": false,
|
|
21
18
|
"scripts": {
|
|
22
19
|
"test": "npm-run-all --print-label build --parallel lint:* --parallel test:*",
|
|
23
20
|
"lint:lockfile": "lockfile-lint --path package-lock.json --type npm --validate-https --allowed-hosts npm",
|
|
24
21
|
"lint:js": "eslint . --cache",
|
|
25
|
-
"lint:md": "remark . --frail",
|
|
26
|
-
"generate:md": "remark . --output",
|
|
22
|
+
"lint:md": "NODE_OPTIONS=--loader=testdouble remark . --frail",
|
|
27
23
|
"pregenerate:md": "run-s build",
|
|
24
|
+
"generate:md": "NODE_OPTIONS=\"--loader=testdouble --enable-source-maps\" remark . --output",
|
|
28
25
|
"lint:sensitive": "ban",
|
|
29
26
|
"pretest:integration:base": "run-s build",
|
|
30
27
|
"lint:gherkin": "gherkin-lint",
|
|
31
28
|
"test:integration": "run-s 'test:integration:base -- --profile noWip'",
|
|
32
|
-
"test:integration:base": "DEBUG=any cucumber-js test/integration
|
|
29
|
+
"test:integration:base": "NODE_OPTIONS=\"--loader=testdouble --enable-source-maps\" DEBUG=any cucumber-js test/integration",
|
|
33
30
|
"test:integration:debug": "DEBUG=test run-s test:integration",
|
|
34
31
|
"test:integration:wip": "run-s 'test:integration:base -- --profile wip'",
|
|
35
32
|
"test:integration:wip:debug": "DEBUG=test run-s 'test:integration:wip'",
|
|
@@ -41,7 +38,7 @@
|
|
|
41
38
|
"watch": "run-s 'build:js -- --watch'",
|
|
42
39
|
"prepack": "run-s build",
|
|
43
40
|
"test:unit": "cross-env NODE_ENV=test c8 run-s test:unit:base",
|
|
44
|
-
"test:unit:base": "DEBUG=any
|
|
41
|
+
"test:unit:base": "DEBUG=any vitest run",
|
|
45
42
|
"lint:peer": "npm ls >/dev/null",
|
|
46
43
|
"prepare": "husky install",
|
|
47
44
|
"lint:engines": "ls-engines"
|
|
@@ -61,38 +58,35 @@
|
|
|
61
58
|
"write-yaml": "^1.0.0"
|
|
62
59
|
},
|
|
63
60
|
"devDependencies": {
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"@form8ion/
|
|
67
|
-
"@form8ion/commitlint-config": "1.0.43",
|
|
68
|
-
"@form8ion/eslint-config": "5.0.24",
|
|
61
|
+
"@cucumber/cucumber": "9.0.1",
|
|
62
|
+
"@form8ion/commitlint-config": "1.0.46",
|
|
63
|
+
"@form8ion/eslint-config": "5.0.27",
|
|
69
64
|
"@form8ion/eslint-config-cucumber": "1.4.1",
|
|
70
|
-
"@form8ion/eslint-config-mocha": "2.0.3",
|
|
71
65
|
"@form8ion/remark-lint-preset": "5.0.0",
|
|
72
|
-
"@travi/any": "2.1.
|
|
66
|
+
"@travi/any": "2.1.8",
|
|
73
67
|
"@travi/github-scaffolder": "8.0.4",
|
|
74
68
|
"ban-sensitive-files": "1.9.18",
|
|
75
|
-
"c8": "7.
|
|
69
|
+
"c8": "7.13.0",
|
|
76
70
|
"chai": "4.3.7",
|
|
77
71
|
"cross-env": "7.0.3",
|
|
78
72
|
"cz-conventional-changelog": "3.3.0",
|
|
79
73
|
"debug": "4.3.4",
|
|
80
74
|
"gherkin-lint": "4.2.2",
|
|
81
75
|
"husky": "8.0.3",
|
|
76
|
+
"jest-when": "3.5.2",
|
|
82
77
|
"js-yaml": "4.1.0",
|
|
83
|
-
"lockfile-lint": "4.10.
|
|
78
|
+
"lockfile-lint": "4.10.1",
|
|
84
79
|
"ls-engines": "0.9.0",
|
|
85
|
-
"mocha": "10.2.0",
|
|
86
80
|
"mock-fs": "5.2.0",
|
|
87
81
|
"nock": "13.3.0",
|
|
88
82
|
"npm-run-all": "4.1.5",
|
|
89
83
|
"remark-cli": "11.0.0",
|
|
90
84
|
"remark-toc": "8.0.1",
|
|
91
85
|
"remark-usage": "10.0.1",
|
|
92
|
-
"rimraf": "4.1
|
|
93
|
-
"rollup": "3.
|
|
86
|
+
"rimraf": "4.4.1",
|
|
87
|
+
"rollup": "3.20.2",
|
|
94
88
|
"rollup-plugin-auto-external": "2.0.0",
|
|
95
|
-
"
|
|
96
|
-
"
|
|
89
|
+
"testdouble": "3.17.1",
|
|
90
|
+
"vitest": "0.29.7"
|
|
97
91
|
}
|
|
98
92
|
}
|
package/lib/index.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var fs = require('fs');
|
|
4
|
-
var util = require('util');
|
|
5
|
-
var yaml = require('write-yaml');
|
|
6
|
-
var deepmerge = require('deepmerge');
|
|
7
|
-
var javascript = require('@form8ion/javascript');
|
|
8
|
-
var javascriptCore = require('@form8ion/javascript-core');
|
|
9
|
-
var project = require('@form8ion/project');
|
|
10
|
-
|
|
11
|
-
var writeYaml = util.promisify(yaml);
|
|
12
|
-
|
|
13
|
-
async function scaffold ({projectRoot, scope, projectName}) {
|
|
14
|
-
const configShortName = projectName.substring('eslint-config-'.length);
|
|
15
|
-
|
|
16
|
-
await Promise.all([
|
|
17
|
-
writeYaml(`${projectRoot}/.eslintrc.yml`, {root: true, extends: [`@${scope}`, '.']}),
|
|
18
|
-
fs.promises.writeFile(
|
|
19
|
-
`${projectRoot}/index.js`,
|
|
20
|
-
`module.exports = {extends: '@form8ion/${configShortName}'};\n`
|
|
21
|
-
),
|
|
22
|
-
fs.promises.writeFile(
|
|
23
|
-
`${projectRoot}/example.js`,
|
|
24
|
-
`module.exports = {
|
|
25
|
-
extends: [
|
|
26
|
-
'@${scope}',
|
|
27
|
-
'@${scope}/${configShortName}'
|
|
28
|
-
]
|
|
29
|
-
};
|
|
30
|
-
`
|
|
31
|
-
)
|
|
32
|
-
]);
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
scripts: {'lint:js': 'eslint .'},
|
|
36
|
-
dependencies: [`@form8ion/${projectName}`],
|
|
37
|
-
devDependencies: [`@${scope}/eslint-config`],
|
|
38
|
-
nextSteps: [
|
|
39
|
-
{summary: 'Save the extended `@form8ion` eslint-config as an exact version'},
|
|
40
|
-
{summary: 'Document saving this config using the dev flag'},
|
|
41
|
-
{summary: 'Link to the extended `@form8ion` config in the README'}
|
|
42
|
-
]
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const PLUGIN_NAME = 'ESLint Config';
|
|
47
|
-
|
|
48
|
-
function highLevel (options, javascriptScaffolderFactory) {
|
|
49
|
-
const javaScriptLanguageChoice = 'JavaScript';
|
|
50
|
-
|
|
51
|
-
return project.scaffold(
|
|
52
|
-
deepmerge(
|
|
53
|
-
options,
|
|
54
|
-
{
|
|
55
|
-
decisions: {[project.questionNames.PROJECT_LANGUAGE]: javaScriptLanguageChoice},
|
|
56
|
-
languages: {
|
|
57
|
-
[javaScriptLanguageChoice]: javascriptScaffolderFactory({
|
|
58
|
-
...options.decisions,
|
|
59
|
-
[javascript.questionNames.PROJECT_TYPE]: 'Package',
|
|
60
|
-
[javascript.questionNames.PROJECT_TYPE_CHOICE]: PLUGIN_NAME,
|
|
61
|
-
[javascript.questionNames.UNIT_TESTS]: false,
|
|
62
|
-
[javascript.questionNames.INTEGRATION_TESTS]: false,
|
|
63
|
-
[javascript.questionNames.CONFIGURE_LINTING]: false,
|
|
64
|
-
[javascript.questionNames.DIALECT]: javascriptCore.dialects.COMMON_JS,
|
|
65
|
-
[javascript.questionNames.SHOULD_BE_SCOPED]: true
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
exports.PLUGIN_NAME = PLUGIN_NAME;
|
|
74
|
-
exports.extendEslintConfig = highLevel;
|
|
75
|
-
exports.scaffold = scaffold;
|
|
76
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../thirdparty-wrappers/write-yaml.js","../src/scaffold.js","../src/constants.js","../src/high-level.js"],"sourcesContent":["import {promisify} from 'util';\nimport yaml from 'write-yaml';\n\nexport default promisify(yaml);\n","import {promises as fs} from 'fs';\nimport writeYaml from '../thirdparty-wrappers/write-yaml';\n\nexport default async function ({projectRoot, scope, projectName}) {\n const configShortName = projectName.substring('eslint-config-'.length);\n\n await Promise.all([\n writeYaml(`${projectRoot}/.eslintrc.yml`, {root: true, extends: [`@${scope}`, '.']}),\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 {scaffold, questionNames as projectQuestionNames} from '@form8ion/project';\nimport {PLUGIN_NAME} from './constants';\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 languages: {\n [javaScriptLanguageChoice]: 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"],"names":["promisify","fs","scaffold","projectQuestionNames","jsQuestionNames","dialects"],"mappings":";;;;;;;;;;AAGA,gBAAeA,cAAS,CAAC,IAAI,CAAC;;ACAf,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,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACxF,IAAIC,WAAE,CAAC,SAAS;AAChB,MAAM,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC;AAC/B,MAAM,CAAC,sCAAsC,EAAE,eAAe,CAAC,KAAK,CAAC;AACrE,KAAK;AACL,IAAIA,WAAE,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,CAAC;AACD,KAAK;AACL,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO;AACT,IAAI,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;AACpC,IAAI,YAAY,EAAE,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;AAC9C,IAAI,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;AAChD,IAAI,SAAS,EAAE;AACf,MAAM,CAAC,OAAO,EAAE,iEAAiE,CAAC;AAClF,MAAM,CAAC,OAAO,EAAE,gDAAgD,CAAC;AACjE,MAAM,CAAC,OAAO,EAAE,uDAAuD,CAAC;AACxE,KAAK;AACL,GAAG,CAAC;AACJ;;AClCY,MAAC,WAAW,GAAG;;ACMZ,kBAAQ,EAAE,OAAO,EAAE,2BAA2B,EAAE;AAC/D,EAAE,MAAM,wBAAwB,GAAG,YAAY,CAAC;AAChD;AACA,EAAE,OAAOC,gBAAQ;AACjB,IAAI,SAAS;AACb,MAAM,OAAO;AACb,MAAM;AACN,QAAQ,SAAS,EAAE,CAAC,CAACC,qBAAoB,CAAC,gBAAgB,GAAG,wBAAwB,CAAC;AACtF,QAAQ,SAAS,EAAE;AACnB,UAAU,CAAC,wBAAwB,GAAG,2BAA2B,CAAC;AAClE,YAAY,GAAG,OAAO,CAAC,SAAS;AAChC,YAAY,CAACC,wBAAe,CAAC,YAAY,GAAG,SAAS;AACrD,YAAY,CAACA,wBAAe,CAAC,mBAAmB,GAAG,WAAW;AAC9D,YAAY,CAACA,wBAAe,CAAC,UAAU,GAAG,KAAK;AAC/C,YAAY,CAACA,wBAAe,CAAC,iBAAiB,GAAG,KAAK;AACtD,YAAY,CAACA,wBAAe,CAAC,iBAAiB,GAAG,KAAK;AACtD,YAAY,CAACA,wBAAe,CAAC,OAAO,GAAGC,uBAAQ,CAAC,SAAS;AACzD,YAAY,CAACD,wBAAe,CAAC,gBAAgB,GAAG,IAAI;AACpD,WAAW,CAAC;AACZ,SAAS;AACT,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;;;"}
|