@luxass/eslint-config 4.0.0 → 4.0.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.
@@ -257,6 +257,13 @@ async function javascript(options = {}) {
257
257
  rules: {
258
258
  "no-console": "off"
259
259
  }
260
+ },
261
+ {
262
+ name: "luxass:playground-overrides",
263
+ files: [`**/playground.${GLOB_SRC_EXT}`],
264
+ rules: {
265
+ "no-console": "off"
266
+ }
260
267
  }
261
268
  ];
262
269
  }
@@ -8,6 +8,7 @@ import {
8
8
  } from "./chunk-ATRL3UZP.mjs";
9
9
 
10
10
  // src/configs/react.ts
11
+ import { isPackageExists } from "local-pkg";
11
12
  async function react(options = {}) {
12
13
  const {
13
14
  a11y = false,
@@ -32,6 +33,9 @@ async function react(options = {}) {
32
33
  interop(import("eslint-plugin-react-refresh")),
33
34
  ...a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
34
35
  ]);
36
+ const isAllowConstantExport = ["vite"].some(
37
+ (i) => isPackageExists(i)
38
+ );
35
39
  return [
36
40
  {
37
41
  name: "luxass:react:setup",
@@ -267,8 +271,9 @@ async function react(options = {}) {
267
271
  "react-hooks/exhaustive-deps": "warn",
268
272
  "react-hooks/rules-of-hooks": "error",
269
273
  // react refresh
270
- "react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
274
+ "react-refresh/only-export-components": ["warn", { allowConstantExport: isAllowConstantExport }],
271
275
  ...typescript ? {
276
+ "react/jsx-no-undef": "off",
272
277
  "react/prop-type": "off"
273
278
  } : {},
274
279
  // overrides
@@ -5,6 +5,7 @@ import {
5
5
  } from "./chunk-4YBQZLPS.mjs";
6
6
  import {
7
7
  GLOB_SRC,
8
+ GLOB_SRC_EXT,
8
9
  GLOB_TS,
9
10
  GLOB_TSX
10
11
  } from "./chunk-ATRL3UZP.mjs";
@@ -184,6 +185,13 @@ async function typescript(options = {}) {
184
185
  "no-unused-expressions": "off"
185
186
  }
186
187
  },
188
+ {
189
+ name: "luxass:typescript:playground-overrides",
190
+ files: [`**/playground.${GLOB_SRC_EXT}`],
191
+ rules: {
192
+ "no-console": "off"
193
+ }
194
+ },
187
195
  {
188
196
  name: "luxass:typescript:javascript-overrides",
189
197
  files: ["**/*.js", "**/*.cjs"],
@@ -764,6 +764,13 @@ async function javascript(options = {}) {
764
764
  rules: {
765
765
  "no-console": "off"
766
766
  }
767
+ },
768
+ {
769
+ name: "luxass:playground-overrides",
770
+ files: [`**/playground.${GLOB_SRC_EXT}`],
771
+ rules: {
772
+ "no-console": "off"
773
+ }
767
774
  }
768
775
  ];
769
776
  }
@@ -1249,6 +1256,13 @@ async function typescript(options = {}) {
1249
1256
  "no-unused-expressions": "off"
1250
1257
  }
1251
1258
  },
1259
+ {
1260
+ name: "luxass:typescript:playground-overrides",
1261
+ files: [`**/playground.${GLOB_SRC_EXT}`],
1262
+ rules: {
1263
+ "no-console": "off"
1264
+ }
1265
+ },
1252
1266
  {
1253
1267
  name: "luxass:typescript:javascript-overrides",
1254
1268
  files: ["**/*.js", "**/*.cjs"],
@@ -1775,6 +1789,7 @@ async function nextjs(options = {}) {
1775
1789
  }
1776
1790
 
1777
1791
  // src/configs/react.ts
1792
+ var import_local_pkg2 = require("local-pkg");
1778
1793
  async function react(options = {}) {
1779
1794
  const {
1780
1795
  a11y = false,
@@ -1799,6 +1814,9 @@ async function react(options = {}) {
1799
1814
  interop(import("eslint-plugin-react-refresh")),
1800
1815
  ...a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
1801
1816
  ]);
1817
+ const isAllowConstantExport = ["vite"].some(
1818
+ (i) => (0, import_local_pkg2.isPackageExists)(i)
1819
+ );
1802
1820
  return [
1803
1821
  {
1804
1822
  name: "luxass:react:setup",
@@ -2034,8 +2052,9 @@ async function react(options = {}) {
2034
2052
  "react-hooks/exhaustive-deps": "warn",
2035
2053
  "react-hooks/rules-of-hooks": "error",
2036
2054
  // react refresh
2037
- "react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
2055
+ "react-refresh/only-export-components": ["warn", { allowConstantExport: isAllowConstantExport }],
2038
2056
  ...typescript2 ? {
2057
+ "react/jsx-no-undef": "off",
2039
2058
  "react/prop-type": "off"
2040
2059
  } : {},
2041
2060
  // overrides
@@ -18,7 +18,7 @@ import {
18
18
  import "../chunk-WDSV2EFG.mjs";
19
19
  import {
20
20
  typescript
21
- } from "../chunk-P3QUAOFO.mjs";
21
+ } from "../chunk-Z7F6QSYQ.mjs";
22
22
  import {
23
23
  unicorn
24
24
  } from "../chunk-RVSUTDCE.mjs";
@@ -27,7 +27,7 @@ import {
27
27
  } from "../chunk-KJ7ZCBK4.mjs";
28
28
  import {
29
29
  javascript
30
- } from "../chunk-QK56GX3F.mjs";
30
+ } from "../chunk-7R4FYLS2.mjs";
31
31
  import {
32
32
  jsdoc
33
33
  } from "../chunk-DVQQVCGF.mjs";
@@ -48,7 +48,7 @@ import {
48
48
  } from "../chunk-6T7MXPCT.mjs";
49
49
  import {
50
50
  react
51
- } from "../chunk-DZCXT6HT.mjs";
51
+ } from "../chunk-RNFKNSHW.mjs";
52
52
  import {
53
53
  astro
54
54
  } from "../chunk-GBLPCM3X.mjs";
@@ -312,6 +312,13 @@ async function javascript(options = {}) {
312
312
  rules: {
313
313
  "no-console": "off"
314
314
  }
315
+ },
316
+ {
317
+ name: "luxass:playground-overrides",
318
+ files: [`**/playground.${GLOB_SRC_EXT}`],
319
+ rules: {
320
+ "no-console": "off"
321
+ }
315
322
  }
316
323
  ];
317
324
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  javascript
3
- } from "../chunk-QK56GX3F.mjs";
3
+ } from "../chunk-7R4FYLS2.mjs";
4
4
  import "../chunk-ATRL3UZP.mjs";
5
5
  export {
6
6
  javascript
@@ -33,6 +33,7 @@ __export(react_exports, {
33
33
  react: () => react
34
34
  });
35
35
  module.exports = __toCommonJS(react_exports);
36
+ var import_local_pkg2 = require("local-pkg");
36
37
 
37
38
  // src/globs.ts
38
39
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
@@ -118,6 +119,9 @@ async function react(options = {}) {
118
119
  interop(import("eslint-plugin-react-refresh")),
119
120
  ...a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
120
121
  ]);
122
+ const isAllowConstantExport = ["vite"].some(
123
+ (i) => (0, import_local_pkg2.isPackageExists)(i)
124
+ );
121
125
  return [
122
126
  {
123
127
  name: "luxass:react:setup",
@@ -353,8 +357,9 @@ async function react(options = {}) {
353
357
  "react-hooks/exhaustive-deps": "warn",
354
358
  "react-hooks/rules-of-hooks": "error",
355
359
  // react refresh
356
- "react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
360
+ "react-refresh/only-export-components": ["warn", { allowConstantExport: isAllowConstantExport }],
357
361
  ...typescript ? {
362
+ "react/jsx-no-undef": "off",
358
363
  "react/prop-type": "off"
359
364
  } : {},
360
365
  // overrides
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  react
3
- } from "../chunk-DZCXT6HT.mjs";
3
+ } from "../chunk-RNFKNSHW.mjs";
4
4
  import "../chunk-4YBQZLPS.mjs";
5
5
  import "../chunk-ATRL3UZP.mjs";
6
6
  export {
@@ -256,6 +256,13 @@ async function typescript(options = {}) {
256
256
  "no-unused-expressions": "off"
257
257
  }
258
258
  },
259
+ {
260
+ name: "luxass:typescript:playground-overrides",
261
+ files: [`**/playground.${GLOB_SRC_EXT}`],
262
+ rules: {
263
+ "no-console": "off"
264
+ }
265
+ },
259
266
  {
260
267
  name: "luxass:typescript:javascript-overrides",
261
268
  files: ["**/*.js", "**/*.cjs"],
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  typescript
3
- } from "../chunk-P3QUAOFO.mjs";
3
+ } from "../chunk-Z7F6QSYQ.mjs";
4
4
  import "../chunk-4YBQZLPS.mjs";
5
5
  import "../chunk-ATRL3UZP.mjs";
6
6
  export {
package/dist/index.cjs CHANGED
@@ -61,7 +61,7 @@ module.exports = __toCommonJS(src_exports);
61
61
  // src/factory.ts
62
62
  var import_node_process3 = __toESM(require("process"), 1);
63
63
  var import_node_fs = require("fs");
64
- var import_local_pkg2 = require("local-pkg");
64
+ var import_local_pkg3 = require("local-pkg");
65
65
 
66
66
  // src/configs/comments.ts
67
67
  var import_eslint_plugin_eslint_comments = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
@@ -772,6 +772,13 @@ async function javascript(options = {}) {
772
772
  rules: {
773
773
  "no-console": "off"
774
774
  }
775
+ },
776
+ {
777
+ name: "luxass:playground-overrides",
778
+ files: [`**/playground.${GLOB_SRC_EXT}`],
779
+ rules: {
780
+ "no-console": "off"
781
+ }
775
782
  }
776
783
  ];
777
784
  }
@@ -1270,6 +1277,13 @@ async function typescript(options = {}) {
1270
1277
  "no-unused-expressions": "off"
1271
1278
  }
1272
1279
  },
1280
+ {
1281
+ name: "luxass:typescript:playground-overrides",
1282
+ files: [`**/playground.${GLOB_SRC_EXT}`],
1283
+ rules: {
1284
+ "no-console": "off"
1285
+ }
1286
+ },
1273
1287
  {
1274
1288
  name: "luxass:typescript:javascript-overrides",
1275
1289
  files: ["**/*.js", "**/*.cjs"],
@@ -1796,6 +1810,7 @@ async function nextjs(options = {}) {
1796
1810
  }
1797
1811
 
1798
1812
  // src/configs/react.ts
1813
+ var import_local_pkg2 = require("local-pkg");
1799
1814
  async function react(options = {}) {
1800
1815
  const {
1801
1816
  a11y = false,
@@ -1820,6 +1835,9 @@ async function react(options = {}) {
1820
1835
  interop(import("eslint-plugin-react-refresh")),
1821
1836
  ...a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
1822
1837
  ]);
1838
+ const isAllowConstantExport = ["vite"].some(
1839
+ (i) => (0, import_local_pkg2.isPackageExists)(i)
1840
+ );
1823
1841
  return [
1824
1842
  {
1825
1843
  name: "luxass:react:setup",
@@ -2055,8 +2073,9 @@ async function react(options = {}) {
2055
2073
  "react-hooks/exhaustive-deps": "warn",
2056
2074
  "react-hooks/rules-of-hooks": "error",
2057
2075
  // react refresh
2058
- "react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
2076
+ "react-refresh/only-export-components": ["warn", { allowConstantExport: isAllowConstantExport }],
2059
2077
  ...typescript2 ? {
2078
+ "react/jsx-no-undef": "off",
2060
2079
  "react/prop-type": "off"
2061
2080
  } : {},
2062
2081
  // overrides
@@ -2432,16 +2451,16 @@ async function toml(options = {}) {
2432
2451
  // src/factory.ts
2433
2452
  async function luxass(options = {}, ...userConfigs) {
2434
2453
  const {
2435
- astro: enableAstro = (0, import_local_pkg2.isPackageExists)("astro"),
2454
+ astro: enableAstro = (0, import_local_pkg3.isPackageExists)("astro"),
2436
2455
  editor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM) && !import_node_process3.default.env.CI),
2437
2456
  exts = [],
2438
2457
  gitignore: enableGitignore = true,
2439
2458
  nextjs: enableNextJS = false,
2440
2459
  react: enableReact = false,
2441
2460
  tailwindcss: enableTailwindCSS = false,
2442
- typescript: enableTypeScript = (0, import_local_pkg2.isPackageExists)("typescript"),
2461
+ typescript: enableTypeScript = (0, import_local_pkg3.isPackageExists)("typescript"),
2443
2462
  unocss: enableUnoCSS = false,
2444
- vue: enableVue = VUE_PACKAGES.some((i) => (0, import_local_pkg2.isPackageExists)(i))
2463
+ vue: enableVue = VUE_PACKAGES.some((i) => (0, import_local_pkg3.isPackageExists)(i))
2445
2464
  } = options;
2446
2465
  const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
2447
2466
  if (stylisticOptions && !("jsx" in stylisticOptions)) {
@@ -2495,7 +2514,7 @@ async function luxass(options = {}, ...userConfigs) {
2495
2514
  overrides: getOverrides(options, "test")
2496
2515
  }));
2497
2516
  }
2498
- if (enableReact) {
2517
+ if (enableReact || enableNextJS) {
2499
2518
  configs.push(react({
2500
2519
  overrides: getOverrides(options, "react"),
2501
2520
  typescript: !!enableTypeScript
package/dist/index.mjs CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  import "./chunk-WDSV2EFG.mjs";
22
22
  import {
23
23
  typescript
24
- } from "./chunk-P3QUAOFO.mjs";
24
+ } from "./chunk-Z7F6QSYQ.mjs";
25
25
  import {
26
26
  unicorn
27
27
  } from "./chunk-RVSUTDCE.mjs";
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-KJ7ZCBK4.mjs";
31
31
  import {
32
32
  javascript
33
- } from "./chunk-QK56GX3F.mjs";
33
+ } from "./chunk-7R4FYLS2.mjs";
34
34
  import {
35
35
  jsdoc
36
36
  } from "./chunk-DVQQVCGF.mjs";
@@ -51,7 +51,7 @@ import {
51
51
  } from "./chunk-6T7MXPCT.mjs";
52
52
  import {
53
53
  react
54
- } from "./chunk-DZCXT6HT.mjs";
54
+ } from "./chunk-RNFKNSHW.mjs";
55
55
  import {
56
56
  astro
57
57
  } from "./chunk-GBLPCM3X.mjs";
@@ -162,7 +162,7 @@ async function luxass(options = {}, ...userConfigs) {
162
162
  overrides: getOverrides(options, "test")
163
163
  }));
164
164
  }
165
- if (enableReact) {
165
+ if (enableReact || enableNextJS) {
166
166
  configs.push(react({
167
167
  overrides: getOverrides(options, "react"),
168
168
  typescript: !!enableTypeScript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "ESLint config for @luxass",
5
5
  "type": "module",
6
6
  "author": {