@jsse/eslint-config 0.4.4 → 0.4.6

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __commonJS, __export, __toESM } from "./chunk-CkHaCily.js";
2
- import { VERSION } from "./version-eB55legw.js";
2
+ import { VERSION } from "./version-B7_cTDO2.js";
3
3
  import { builtinModules, createRequire } from "node:module";
4
4
  import fs, { promises, realpathSync, statSync } from "node:fs";
5
5
  import process$1 from "node:process";
@@ -15,7 +15,7 @@ import pluginTs from "@typescript-eslint/eslint-plugin";
15
15
  import * as parserTs from "@typescript-eslint/parser";
16
16
  import pluginAntfu from "eslint-plugin-antfu";
17
17
  import pluginDeMorgan from "eslint-plugin-de-morgan";
18
- import * as pluginImport from "eslint-plugin-import-x";
18
+ import pluginImportLite from "eslint-plugin-import-lite";
19
19
  import pluginN from "eslint-plugin-n";
20
20
  import pluginPerfectionist from "eslint-plugin-perfectionist";
21
21
  import pluginPnpm from "eslint-plugin-pnpm";
@@ -36,7 +36,6 @@ const SLOW_RULES = [
36
36
  "@typescript-eslint/no-unsafe-member-access",
37
37
  "@typescript-eslint/no-unsafe-return",
38
38
  "import/no-duplicates",
39
- "import/no-self-import",
40
39
  "jsdoc/check-access",
41
40
  "jsdoc/check-alignment",
42
41
  "jsdoc/check-property-names",
@@ -52,7 +51,7 @@ const SLOW_RULES = [
52
51
  ];
53
52
 
54
53
  //#endregion
55
- //#region node_modules/.pnpm/acorn@8.14.1/node_modules/acorn/dist/acorn.mjs
54
+ //#region node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs
56
55
  var astralIdentifierCodes = [
57
56
  509,
58
57
  0,
@@ -1673,6 +1672,44 @@ pp$8.isAsyncFunction = function() {
1673
1672
  var next = this.pos + skip[0].length, after;
1674
1673
  return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320));
1675
1674
  };
1675
+ pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
1676
+ if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using")) {
1677
+ return false;
1678
+ }
1679
+ skipWhiteSpace.lastIndex = this.pos;
1680
+ var skip = skipWhiteSpace.exec(this.input);
1681
+ var next = this.pos + skip[0].length;
1682
+ if (lineBreak.test(this.input.slice(this.pos, next))) {
1683
+ return false;
1684
+ }
1685
+ if (isAwaitUsing) {
1686
+ var awaitEndPos = next + 5, after;
1687
+ if (this.input.slice(next, awaitEndPos) !== "using" || awaitEndPos === this.input.length || isIdentifierChar(after = this.input.charCodeAt(awaitEndPos)) || after > 55295 && after < 56320) {
1688
+ return false;
1689
+ }
1690
+ skipWhiteSpace.lastIndex = awaitEndPos;
1691
+ var skipAfterUsing = skipWhiteSpace.exec(this.input);
1692
+ if (skipAfterUsing && lineBreak.test(this.input.slice(awaitEndPos, awaitEndPos + skipAfterUsing[0].length))) {
1693
+ return false;
1694
+ }
1695
+ }
1696
+ if (isFor) {
1697
+ var ofEndPos = next + 2, after$1;
1698
+ if (this.input.slice(next, ofEndPos) === "of") {
1699
+ if (ofEndPos === this.input.length || !isIdentifierChar(after$1 = this.input.charCodeAt(ofEndPos)) && !(after$1 > 55295 && after$1 < 56320)) {
1700
+ return false;
1701
+ }
1702
+ }
1703
+ }
1704
+ var ch = this.input.charCodeAt(next);
1705
+ return isIdentifierStart(ch, true) || ch === 92;
1706
+ };
1707
+ pp$8.isAwaitUsing = function(isFor) {
1708
+ return this.isUsingKeyword(true, isFor);
1709
+ };
1710
+ pp$8.isUsing = function(isFor) {
1711
+ return this.isUsingKeyword(false, isFor);
1712
+ };
1676
1713
  pp$8.parseStatement = function(context, topLevel, exports) {
1677
1714
  var starttype = this.type, node = this.startNode(), kind;
1678
1715
  if (this.isLet(context)) {
@@ -1738,6 +1775,22 @@ pp$8.parseStatement = function(context, topLevel, exports) {
1738
1775
  this.next();
1739
1776
  return this.parseFunctionStatement(node, true, !context);
1740
1777
  }
1778
+ var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
1779
+ if (usingKind) {
1780
+ if (topLevel && this.options.sourceType === "script") {
1781
+ this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`");
1782
+ }
1783
+ if (usingKind === "await using") {
1784
+ if (!this.canAwait) {
1785
+ this.raise(this.start, "Await using cannot appear outside of async function");
1786
+ }
1787
+ this.next();
1788
+ }
1789
+ this.next();
1790
+ this.parseVar(node, false, usingKind);
1791
+ this.semicolon();
1792
+ return this.finishNode(node, "VariableDeclaration");
1793
+ }
1741
1794
  var maybeName = this.value, expr = this.parseExpression();
1742
1795
  if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) {
1743
1796
  return this.parseLabeledStatement(node, maybeName, expr, context);
@@ -1811,24 +1864,20 @@ pp$8.parseForStatement = function(node) {
1811
1864
  this.next();
1812
1865
  this.parseVar(init$1, true, kind);
1813
1866
  this.finishNode(init$1, "VariableDeclaration");
1814
- if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) {
1815
- if (this.options.ecmaVersion >= 9) {
1816
- if (this.type === types$1._in) {
1817
- if (awaitAt > -1) {
1818
- this.unexpected(awaitAt);
1819
- }
1820
- } else {
1821
- node.await = awaitAt > -1;
1822
- }
1823
- }
1824
- return this.parseForIn(node, init$1);
1825
- }
1826
- if (awaitAt > -1) {
1827
- this.unexpected(awaitAt);
1828
- }
1829
- return this.parseFor(node, init$1);
1867
+ return this.parseForAfterInit(node, init$1, awaitAt);
1830
1868
  }
1831
1869
  var startsWithLet = this.isContextual("let"), isForOf = false;
1870
+ var usingKind = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
1871
+ if (usingKind) {
1872
+ var init$2 = this.startNode();
1873
+ this.next();
1874
+ if (usingKind === "await using") {
1875
+ this.next();
1876
+ }
1877
+ this.parseVar(init$2, true, usingKind);
1878
+ this.finishNode(init$2, "VariableDeclaration");
1879
+ return this.parseForAfterInit(node, init$2, awaitAt);
1880
+ }
1832
1881
  var containsEsc = this.containsEsc;
1833
1882
  var refDestructuringErrors = new DestructuringErrors();
1834
1883
  var initPos = this.start;
@@ -1860,6 +1909,24 @@ pp$8.parseForStatement = function(node) {
1860
1909
  }
1861
1910
  return this.parseFor(node, init);
1862
1911
  };
1912
+ pp$8.parseForAfterInit = function(node, init, awaitAt) {
1913
+ if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init.declarations.length === 1) {
1914
+ if (this.options.ecmaVersion >= 9) {
1915
+ if (this.type === types$1._in) {
1916
+ if (awaitAt > -1) {
1917
+ this.unexpected(awaitAt);
1918
+ }
1919
+ } else {
1920
+ node.await = awaitAt > -1;
1921
+ }
1922
+ }
1923
+ return this.parseForIn(node, init);
1924
+ }
1925
+ if (awaitAt > -1) {
1926
+ this.unexpected(awaitAt);
1927
+ }
1928
+ return this.parseFor(node, init);
1929
+ };
1863
1930
  pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
1864
1931
  this.next();
1865
1932
  return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync);
@@ -2086,6 +2153,8 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
2086
2153
  decl.init = this.parseMaybeAssign(isFor);
2087
2154
  } else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
2088
2155
  this.unexpected();
2156
+ } else if (!allowMissingInitializer && (kind === "using" || kind === "await using") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.isContextual("of")) {
2157
+ this.raise(this.lastTokEnd, "Missing initializer in " + kind + " declaration");
2089
2158
  } else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
2090
2159
  this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
2091
2160
  } else {
@@ -2099,7 +2168,7 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
2099
2168
  return node;
2100
2169
  };
2101
2170
  pp$8.parseVarId = function(decl, kind) {
2102
- decl.id = this.parseBindingAtom();
2171
+ decl.id = kind === "using" || kind === "await using" ? this.parseIdent() : this.parseBindingAtom();
2103
2172
  this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
2104
2173
  };
2105
2174
  var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;
@@ -3553,7 +3622,7 @@ pp$5.parseLiteral = function(value) {
3553
3622
  node.value = value;
3554
3623
  node.raw = this.input.slice(this.start, this.end);
3555
3624
  if (node.raw.charCodeAt(node.raw.length - 1) === 110) {
3556
- node.bigint = node.raw.slice(0, -1).replace(/_/g, "");
3625
+ node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, "");
3557
3626
  }
3558
3627
  this.next();
3559
3628
  return this.finishNode(node, "Literal");
@@ -6146,7 +6215,7 @@ pp.readWord = function() {
6146
6215
  }
6147
6216
  return this.finishToken(type, word);
6148
6217
  };
6149
- var version = "8.14.1";
6218
+ var version = "8.15.0";
6150
6219
  Parser.acorn = {
6151
6220
  Parser,
6152
6221
  version,
@@ -13091,14 +13160,12 @@ const imports = async (options) => {
13091
13160
  const { stylistic: stylistic$1 = true } = options ?? {};
13092
13161
  return [{
13093
13162
  name: "jsse/import",
13094
- plugins: { import: pluginImport },
13163
+ plugins: { import: pluginImportLite },
13095
13164
  rules: {
13096
13165
  "import/first": "error",
13097
13166
  "import/no-duplicates": "error",
13098
13167
  "import/no-mutable-exports": "error",
13099
13168
  "import/no-named-default": "error",
13100
- "import/no-self-import": "error",
13101
- "import/no-webpack-loader-syntax": "error",
13102
13169
  "import/order": "off",
13103
13170
  ...stylistic$1 ? { "import/newline-after-import": ["error", {
13104
13171
  considerComments: true,
@@ -17857,22 +17924,15 @@ const sortTsconfig = async (options) => {
17857
17924
 
17858
17925
  //#endregion
17859
17926
  //#region src/configs/stylistic.ts
17860
- function jsxStylistic({ indent }) {
17927
+ function jsxStylistic() {
17861
17928
  return {
17862
17929
  "@stylistic/jsx-curly-brace-presence": ["error", { propElementValues: "always" }],
17863
- "@stylistic/jsx-indent": [
17864
- "error",
17865
- indent,
17866
- {
17867
- checkAttributes: true,
17868
- indentLogicalExpressions: true
17869
- }
17870
- ],
17930
+ "@stylistic/jsx-indent-props": ["error", { indentMode: 2 }],
17871
17931
  "@stylistic/jsx-quotes": "error"
17872
17932
  };
17873
17933
  }
17874
17934
  const stylistic = async (options) => {
17875
- const { indent = 2, jsx = true, quotes = "double" } = options ?? {};
17935
+ const { jsx = true, quotes = "double" } = options ?? {};
17876
17936
  const { pluginStylistic } = await importPluginStylistic();
17877
17937
  return [{
17878
17938
  name: "jsse/stylistic",
@@ -17883,11 +17943,11 @@ const stylistic = async (options) => {
17883
17943
  "error",
17884
17944
  quotes,
17885
17945
  {
17886
- allowTemplateLiterals: false,
17946
+ allowTemplateLiterals: "never",
17887
17947
  avoidEscape: true
17888
17948
  }
17889
17949
  ],
17890
- ...jsx ? jsxStylistic({ indent }) : {}
17950
+ ...jsx ? jsxStylistic() : {}
17891
17951
  }
17892
17952
  }];
17893
17953
  };
@@ -18030,7 +18090,7 @@ const typescript = async (options) => {
18030
18090
  {
18031
18091
  name: "jsse/typescript/setup",
18032
18092
  plugins: {
18033
- import: pluginImport,
18093
+ import: pluginImportLite,
18034
18094
  [tsPrefixTo]: pluginTs
18035
18095
  }
18036
18096
  },
@@ -18671,4 +18731,4 @@ const presetAll = makePresetFn([
18671
18731
  ]);
18672
18732
 
18673
18733
  //#endregion
18674
- export { SLOW_RULES, VERSION, changeRuleEntrySeverity, combine, combineAsync, jsse as default, defineConfig, error2warn, globs_exports as globs, importJsoncLibs, importParserJsonc, importPluginJsdoc, importPluginJsonc, importPluginMarkdown, importPluginReact, importPluginReactHooks, importPluginReactRefresh, importPluginStylistic, importPluginTsdoc, importPluginUnicorn, importReactPlugins, importYmlLibs, interopDefault, isCI, isInEditor, jsse, jsseReact, parserPlain, parserTs, pluginAntfu, pluginDeMorgan, pluginEslintComments, pluginImport, pluginN, pluginPerfectionist, pluginPnpm, pluginTs, pluginUnicorn, pluginUnusedImports, renameRules, turnOffRules, uniqueStrings, warn2error };
18734
+ export { SLOW_RULES, VERSION, changeRuleEntrySeverity, combine, combineAsync, jsse as default, defineConfig, error2warn, globs_exports as globs, importJsoncLibs, importParserJsonc, importPluginJsdoc, importPluginJsonc, importPluginMarkdown, importPluginReact, importPluginReactHooks, importPluginReactRefresh, importPluginStylistic, importPluginTsdoc, importPluginUnicorn, importReactPlugins, importYmlLibs, interopDefault, isCI, isInEditor, jsse, jsseReact, parserPlain, parserTs, pluginAntfu, pluginDeMorgan, pluginEslintComments, pluginImportLite, pluginN, pluginPerfectionist, pluginPnpm, pluginTs, pluginUnicorn, pluginUnusedImports, renameRules, turnOffRules, uniqueStrings, warn2error };
@@ -1,5 +1,5 @@
1
1
  //#region src/generated/version.ts
2
- const VERSION = "0.4.4";
2
+ const VERSION = "0.4.6";
3
3
 
4
4
  //#endregion
5
5
  export { VERSION };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jsse/eslint-config",
3
3
  "type": "module",
4
- "version": "0.4.4",
4
+ "version": "0.4.6",
5
5
  "description": "@jsse/eslint-config ~ WYSIWYG",
6
6
  "author": "jessekrubin <jessekrubin@gmail.com> (https://github.com/jessekrubin/)",
7
7
  "license": "MIT",
@@ -59,11 +59,11 @@
59
59
  "dependencies": {
60
60
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
61
61
  "@eslint/compat": "^1.3.1",
62
- "@eslint/js": "~9.30.1",
63
- "@eslint/markdown": "^6.6.0",
64
- "@stylistic/eslint-plugin": "5.1.0",
65
- "@typescript-eslint/eslint-plugin": "^8.36.0",
66
- "@typescript-eslint/parser": "^8.36.0",
62
+ "@eslint/js": "~9.32.0",
63
+ "@eslint/markdown": "^7.1.0",
64
+ "@stylistic/eslint-plugin": "5.2.2",
65
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
66
+ "@typescript-eslint/parser": "^8.38.0",
67
67
  "@vitest/eslint-plugin": "^1.3.4",
68
68
  "debug": "^4.4.1",
69
69
  "eslint-config-flat-gitignore": "^2.1.0",
@@ -71,51 +71,48 @@
71
71
  "eslint-plugin-antfu": "^3.1.1",
72
72
  "eslint-plugin-command": "^3.3.1",
73
73
  "eslint-plugin-de-morgan": "^1.3.0",
74
- "eslint-plugin-import-x": "^4.16.1",
75
- "eslint-plugin-jsdoc": "^51.3.4",
74
+ "eslint-plugin-import-lite": "^0.3.0",
75
+ "eslint-plugin-jsdoc": "^52.0.0",
76
76
  "eslint-plugin-jsonc": "^2.20.1",
77
- "eslint-plugin-n": "^17.21.0",
77
+ "eslint-plugin-n": "^17.21.3",
78
78
  "eslint-plugin-no-only-tests": "^3.3.0",
79
79
  "eslint-plugin-perfectionist": "^4.15.0",
80
- "eslint-plugin-pnpm": "^1.0.0",
80
+ "eslint-plugin-pnpm": "^1.1.0",
81
81
  "eslint-plugin-react": "~7.37.5",
82
82
  "eslint-plugin-react-hooks": "~5.2.0",
83
83
  "eslint-plugin-react-refresh": "~0.4.20",
84
84
  "eslint-plugin-toml": "^0.12.0",
85
85
  "eslint-plugin-tsdoc": "^0.4.0",
86
- "eslint-plugin-unicorn": "^59.0.1",
86
+ "eslint-plugin-unicorn": "^60.0.0",
87
87
  "eslint-plugin-unused-imports": "^4.1.4",
88
88
  "eslint-plugin-yml": "^1.18.0",
89
89
  "jsonc-eslint-parser": "^2.4.0",
90
90
  "toml-eslint-parser": "^0.10.0",
91
- "typescript-eslint": "^8.36.0",
91
+ "typescript-eslint": "^8.38.0",
92
92
  "yaml-eslint-parser": "^1.3.0"
93
93
  },
94
94
  "devDependencies": {
95
- "@biomejs/biome": "2.0.6",
95
+ "@biomejs/biome": "2.1.2",
96
96
  "@changesets/cli": "^2.29.5",
97
97
  "@jsse/prettier-config": "^1.0.0",
98
98
  "@jsse/tsconfig": "^0.3.0",
99
- "@stylistic/eslint-plugin-jsx": "^4.4.1",
100
99
  "@types/debug": "^4.1.12",
101
- "@types/eslint": "^9.6.1",
102
100
  "@types/fs-extra": "^11.0.4",
103
- "@types/node": "^22.15.30",
101
+ "@types/node": "^22.16.5",
104
102
  "cac": "^6.7.14",
105
- "eslint": "^9.30.1",
103
+ "eslint": "^9.32.0",
106
104
  "eslint-flat-config-utils": "^2.1.0",
107
- "eslint-typegen": "^2.2.1",
105
+ "eslint-typegen": "^2.3.0",
108
106
  "execa": "~9.6.0",
109
107
  "fast-glob": "^3.3.3",
110
108
  "fs-extra": "^11.3.0",
111
109
  "globals": "^16.3.0",
112
110
  "local-pkg": "^1.1.1",
113
- "neverthrow": "^8.2.0",
114
111
  "picocolors": "^1.1.1",
115
112
  "prettier": "^3.6.2",
116
- "react": "~19.1.0",
113
+ "react": "~19.1.1",
117
114
  "rimraf": "^6.0.1",
118
- "tsdown": "^0.12.9",
115
+ "tsdown": "^0.13.0",
119
116
  "tsx": "^4.20.3",
120
117
  "typescript": "5.8.3",
121
118
  "vitest": "^3.2.4"