@coderwyd/eslint-config 2.1.0 → 2.1.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/dist/cli.cjs CHANGED
@@ -46,7 +46,7 @@ var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
46
46
  var import_picocolors = __toESM(require("picocolors"), 1);
47
47
 
48
48
  // package.json
49
- var version = "2.1.0";
49
+ var version = "2.1.1";
50
50
  var devDependencies = {
51
51
  "@antfu/ni": "^0.21.12",
52
52
  "@types/eslint": "^8.56.2",
package/dist/cli.js CHANGED
@@ -17,7 +17,7 @@ import parse from "parse-gitignore";
17
17
  import c from "picocolors";
18
18
 
19
19
  // package.json
20
- var version = "2.1.0";
20
+ var version = "2.1.1";
21
21
  var devDependencies = {
22
22
  "@antfu/ni": "^0.21.12",
23
23
  "@types/eslint": "^8.56.2",
package/dist/index.cjs CHANGED
@@ -1123,7 +1123,7 @@ async function vue(options = {}) {
1123
1123
  "vue/block-order": [
1124
1124
  "error",
1125
1125
  {
1126
- order: ["script", "template", "style"]
1126
+ order: isVue3 ? ["script", "template", "style"] : ["template", "script", "style"]
1127
1127
  }
1128
1128
  ],
1129
1129
  "vue/component-name-in-template-casing": ["error", "PascalCase"],
@@ -1537,18 +1537,10 @@ async function defineConfig(options = {}, ...userConfigs) {
1537
1537
  const configs = [];
1538
1538
  if (enableGitignore) {
1539
1539
  if (typeof enableGitignore !== "boolean") {
1540
- configs.push(
1541
- interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
1542
- r(enableGitignore)
1543
- ])
1544
- );
1540
+ configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)]));
1545
1541
  } else {
1546
1542
  if (import_node_fs.default.existsSync(".gitignore"))
1547
- configs.push(
1548
- interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
1549
- r()
1550
- ])
1551
- );
1543
+ configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
1552
1544
  }
1553
1545
  }
1554
1546
  configs.push(
@@ -1633,15 +1625,10 @@ async function defineConfig(options = {}, ...userConfigs) {
1633
1625
  prettierRules2 = { ...prettierRules2, ...options.prettierRules };
1634
1626
  }
1635
1627
  if (usePrettierrc) {
1636
- const prettierConfig = await loadPrettierConfig(
1637
- options.cwd ?? import_node_process3.default.cwd()
1638
- );
1628
+ const prettierConfig = await loadPrettierConfig(options.cwd ?? import_node_process3.default.cwd());
1639
1629
  Object.assign(prettierRules2, prettierConfig);
1640
1630
  }
1641
- configs.push(
1642
- prettier(prettierRules2),
1643
- formatter(options.formatter, prettierRules2)
1644
- );
1631
+ configs.push(prettier(prettierRules2), formatter(options.formatter, prettierRules2));
1645
1632
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
1646
1633
  if (key in options)
1647
1634
  acc[key] = options[key];
package/dist/index.d.cts CHANGED
@@ -204,10 +204,10 @@ interface OptionsConfig extends OptionsComponentExts {
204
204
  * {
205
205
  * "html": true,
206
206
  * "css": true,
207
- * "graphql": true,
208
- * "markdown": true
209
- * "yaml": true
210
- * "toml": true
207
+ * "graphql": false,
208
+ * "markdown": false
209
+ * "yaml": false
210
+ * "toml": false
211
211
  * }
212
212
  */
213
213
  formatter?: OptionsFormatters;
package/dist/index.d.ts CHANGED
@@ -204,10 +204,10 @@ interface OptionsConfig extends OptionsComponentExts {
204
204
  * {
205
205
  * "html": true,
206
206
  * "css": true,
207
- * "graphql": true,
208
- * "markdown": true
209
- * "yaml": true
210
- * "toml": true
207
+ * "graphql": false,
208
+ * "markdown": false
209
+ * "yaml": false
210
+ * "toml": false
211
211
  * }
212
212
  */
213
213
  formatter?: OptionsFormatters;
package/dist/index.js CHANGED
@@ -1089,7 +1089,7 @@ async function vue(options = {}) {
1089
1089
  "vue/block-order": [
1090
1090
  "error",
1091
1091
  {
1092
- order: ["script", "template", "style"]
1092
+ order: isVue3 ? ["script", "template", "style"] : ["template", "script", "style"]
1093
1093
  }
1094
1094
  ],
1095
1095
  "vue/component-name-in-template-casing": ["error", "PascalCase"],
@@ -1503,18 +1503,10 @@ async function defineConfig(options = {}, ...userConfigs) {
1503
1503
  const configs = [];
1504
1504
  if (enableGitignore) {
1505
1505
  if (typeof enableGitignore !== "boolean") {
1506
- configs.push(
1507
- interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
1508
- r(enableGitignore)
1509
- ])
1510
- );
1506
+ configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)]));
1511
1507
  } else {
1512
1508
  if (fs.existsSync(".gitignore"))
1513
- configs.push(
1514
- interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
1515
- r()
1516
- ])
1517
- );
1509
+ configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
1518
1510
  }
1519
1511
  }
1520
1512
  configs.push(
@@ -1599,15 +1591,10 @@ async function defineConfig(options = {}, ...userConfigs) {
1599
1591
  prettierRules2 = { ...prettierRules2, ...options.prettierRules };
1600
1592
  }
1601
1593
  if (usePrettierrc) {
1602
- const prettierConfig = await loadPrettierConfig(
1603
- options.cwd ?? process3.cwd()
1604
- );
1594
+ const prettierConfig = await loadPrettierConfig(options.cwd ?? process3.cwd());
1605
1595
  Object.assign(prettierRules2, prettierConfig);
1606
1596
  }
1607
- configs.push(
1608
- prettier(prettierRules2),
1609
- formatter(options.formatter, prettierRules2)
1610
- );
1597
+ configs.push(prettier(prettierRules2), formatter(options.formatter, prettierRules2));
1611
1598
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
1612
1599
  if (key in options)
1613
1600
  acc[key] = options[key];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coderwyd/eslint-config",
3
3
  "type": "module",
4
- "version": "2.1.0",
4
+ "version": "2.1.1",
5
5
  "packageManager": "pnpm@8.14.1",
6
6
  "description": "Donny's ESLint config",
7
7
  "author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",