@html-validate/eslint-config 5.3.12 → 5.4.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/dist/cli.js +26 -5
- package/dist/cli.js.map +2 -2
- package/package.json +2 -2
- package/template/eslintrc.js.njk +13 -0
package/dist/cli.js
CHANGED
@@ -8905,7 +8905,7 @@ var require_package = __commonJS({
|
|
8905
8905
|
"package.json"(exports, module2) {
|
8906
8906
|
module2.exports = {
|
8907
8907
|
name: "@html-validate/eslint-config",
|
8908
|
-
version: "5.3.
|
8908
|
+
version: "5.3.12",
|
8909
8909
|
description: "Eslint sharable config used by the various HTML-validate packages",
|
8910
8910
|
keywords: [
|
8911
8911
|
"eslint"
|
@@ -8988,7 +8988,11 @@ async function renderPassthru(src) {
|
|
8988
8988
|
async function renderNunjucks(src, dst, features) {
|
8989
8989
|
import_nunjucks.default.configure(import_path.default.dirname(src), { trimBlocks: true });
|
8990
8990
|
const overrides = Object.values(features).some(Boolean);
|
8991
|
-
const
|
8991
|
+
const typeinfo = features.typeinfo ? {
|
8992
|
+
rootDir: import_path.default.dirname(features.typeinfo),
|
8993
|
+
tsconfig: `./${import_path.default.basename(features.typeinfo)}`
|
8994
|
+
} : false;
|
8995
|
+
const context = __spreadProps(__spreadValues({}, features), { overrides, typeinfo });
|
8992
8996
|
const result = import_nunjucks.default.render(import_path.default.basename(src), context);
|
8993
8997
|
const prettierConfig = await import_prettier.default.resolveConfig(dst, {
|
8994
8998
|
editorconfig: true
|
@@ -9134,6 +9138,9 @@ async function writeConfig(options, features) {
|
|
9134
9138
|
await ensurePkgScript("eslint:fix", "eslint --fix .", options);
|
9135
9139
|
await ensureDependencyRemoved("eslint", options);
|
9136
9140
|
await ensureDependencyExists("@html-validate/eslint-config", options);
|
9141
|
+
if (features.typeinfo) {
|
9142
|
+
await ensureDependencyExists("@html-validate/eslint-config-typescript-typeinfo", options);
|
9143
|
+
}
|
9137
9144
|
if (features.typescript) {
|
9138
9145
|
await ensureDependencyExists("@html-validate/eslint-config-typescript", options);
|
9139
9146
|
}
|
@@ -9161,7 +9168,7 @@ async function writeConfig(options, features) {
|
|
9161
9168
|
return options.changes === 0;
|
9162
9169
|
}
|
9163
9170
|
async function getFeatures(options, args2) {
|
9164
|
-
var _a, _b, _c, _d, _e, _f;
|
9171
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
9165
9172
|
const dst = import_path2.default.join(options.rootDir, PACKAGE_JSON);
|
9166
9173
|
const data = import_fs2.default.readFileSync(dst, "utf-8");
|
9167
9174
|
const pkg2 = JSON.parse(data);
|
@@ -9171,8 +9178,9 @@ async function getFeatures(options, args2) {
|
|
9171
9178
|
cypress: (_b = args2.cypress) != null ? _b : Boolean(deps.cypress),
|
9172
9179
|
jest: (_c = args2.jest) != null ? _c : Boolean(deps.jest),
|
9173
9180
|
protractor: (_d = args2.protractor) != null ? _d : Boolean(deps.protractor),
|
9174
|
-
|
9175
|
-
|
9181
|
+
typeinfo: (_e = args2.typeinfo) != null ? _e : deps.typescript ? "./tsconfig.json" : false,
|
9182
|
+
typescript: (_f = args2.typescript) != null ? _f : Boolean(deps.typescript),
|
9183
|
+
vue: (_g = args2.vue) != null ? _g : Boolean(deps.vue)
|
9176
9184
|
};
|
9177
9185
|
}
|
9178
9186
|
async function run(args2) {
|
@@ -9230,6 +9238,12 @@ parser.add_argument("--disable-typescript", {
|
|
9230
9238
|
dest: "typescript",
|
9231
9239
|
help: "Disable typescript support"
|
9232
9240
|
});
|
9241
|
+
parser.add_argument("--disable-typeinfo", {
|
9242
|
+
action: "store_const",
|
9243
|
+
const: false,
|
9244
|
+
dest: "typeinfo",
|
9245
|
+
help: "Disable typescript typeinfo support"
|
9246
|
+
});
|
9233
9247
|
parser.add_argument("--disable-angularjs", {
|
9234
9248
|
action: "store_const",
|
9235
9249
|
const: false,
|
@@ -9266,6 +9280,13 @@ parser.add_argument("--enable-typescript", {
|
|
9266
9280
|
dest: "typescript",
|
9267
9281
|
help: "Enable typescript support"
|
9268
9282
|
});
|
9283
|
+
parser.add_argument("--enable-typeinfo", {
|
9284
|
+
nargs: "?",
|
9285
|
+
dest: "typeinfo",
|
9286
|
+
const: "tsconfig.json",
|
9287
|
+
metavar: "TSCONFIG",
|
9288
|
+
help: "Enable typescript typeinfo support"
|
9289
|
+
});
|
9269
9290
|
parser.add_argument("--enable-angularjs", {
|
9270
9291
|
action: "store_const",
|
9271
9292
|
const: true,
|