@pob/eslint-config 67.9.0 → 67.10.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/lib/_base.js CHANGED
@@ -35,6 +35,7 @@ export default [
35
35
  "**/coverage/",
36
36
  "**/.next/",
37
37
  "**/.tamagui/",
38
+ "**/.expo/",
38
39
  "**/*.d.ts",
39
40
  ],
40
41
  },
@@ -0,0 +1,2 @@
1
+ // JS plugin of oxlint/*.json, see ./regexp.js
2
+ export { default } from "@pob/eslint-plugin";
@@ -0,0 +1,5 @@
1
+ // JS plugin of oxlint/*.json. oxlint resolves a package name from the
2
+ // directory of the config file, not from its real path: when this package is
3
+ // symlinked (pnpm or yarn isolated node_modules), its dependencies are not
4
+ // found. Node resolves the imports of this file from its real path.
5
+ export { default } from "eslint-plugin-regexp";
@@ -76,6 +76,12 @@ describe("oxlint rules inventory", () => {
76
76
  Object.keys(inventory)
77
77
  .filter((name) => inventory[name] === "enabled")
78
78
  .toSorted(),
79
- ).toEqual(getEnabledOxlintConfigRules());
79
+ ).toEqual(
80
+ // rules of JS plugins (regexp, @pob) are listed in
81
+ // inventory/eslint-rules.json
82
+ getEnabledOxlintConfigRules().filter((name) =>
83
+ plugins.has(name.slice(0, name.indexOf("/"))),
84
+ ),
85
+ );
80
86
  });
81
87
  });
@@ -9,6 +9,9 @@ const eslintRulePrefixes = new Map([
9
9
  ["node", "n/"],
10
10
  ["react", "react/"],
11
11
  ["jsx_a11y", "jsx-a11y/"],
12
+ // JS plugins: the eslint plugins themselves, loaded by oxlint
13
+ ["regexp", "regexp/"],
14
+ ["@pob", "@pob/"],
12
15
  ]);
13
16
 
14
17
  /** oxlint plugins without eslint equivalent in @pob/eslint-config */
@@ -1,11 +1,14 @@
1
1
  import { describe, expect, it } from "vitest";
2
+ import pobPlugin from "@pob/eslint-plugin";
2
3
  import { Linter } from "eslint";
3
4
  import { builtinRules } from "eslint/use-at-your-own-risk";
4
5
  import importPlugin from "eslint-plugin-import-x";
5
6
  import nodePlugin from "eslint-plugin-n";
7
+ import regexpPlugin from "eslint-plugin-regexp";
6
8
  import eslintPluginUnicorn from "eslint-plugin-unicorn";
7
9
  import tseslint from "typescript-eslint";
8
10
  import oxlintBaseConfig from "../../oxlint/base.json" with { type: "json" };
11
+ import oxlintNodeConfig from "../../oxlint/node.json" with { type: "json" };
9
12
  import oxlintTypescriptConfig from "../../oxlint/typescript.json" with { type: "json" };
10
13
  import {
11
14
  createOxlintDisableDirectivesProcessor,
@@ -163,6 +166,8 @@ describe("oxlint/*.json", () => {
163
166
  ["unicorn/", eslintPluginUnicorn],
164
167
  ["import-x/", importPlugin],
165
168
  ["n/", nodePlugin],
169
+ ["regexp/", regexpPlugin],
170
+ ["@pob/", pobPlugin],
166
171
  ];
167
172
  const eslintRuleNames = new Set([
168
173
  ...builtinRules.keys(),
@@ -175,8 +180,8 @@ describe("oxlint/*.json", () => {
175
180
 
176
181
  it.each([
177
182
  ...new Set(
178
- [oxlintBaseConfig, oxlintTypescriptConfig].flatMap((config) =>
179
- getOxlintConfigRuleNames(config),
183
+ [oxlintBaseConfig, oxlintNodeConfig, oxlintTypescriptConfig].flatMap(
184
+ (config) => getOxlintConfigRuleNames(config),
180
185
  ),
181
186
  ),
182
187
  ])("%s turns off existing eslint rules", (oxlintRuleName) => {
package/oxlint/base.json CHANGED
@@ -3,6 +3,10 @@
3
3
  "correctness": "off"
4
4
  },
5
5
  "plugins": ["import"],
6
+ "jsPlugins": [
7
+ { "name": "@pob", "specifier": "../lib/oxlint-plugins/pob.js" },
8
+ { "name": "regexp", "specifier": "../lib/oxlint-plugins/regexp.js" }
9
+ ],
6
10
  "rules": {
7
11
  "array-callback-return": [
8
12
  "error",
@@ -876,6 +880,67 @@
876
880
  }
877
881
  ],
878
882
  "unicorn/throw-new-error": "error",
883
+ "@pob/forbid-non-native-fetch-import": "error",
884
+ "regexp/confusing-quantifier": "warn",
885
+ "regexp/control-character-escape": "error",
886
+ "regexp/match-any": "error",
887
+ "regexp/negation": "error",
888
+ "regexp/no-contradiction-with-assertion": "error",
889
+ "regexp/no-dupe-characters-character-class": "error",
890
+ "regexp/no-dupe-disjunctions": "error",
891
+ "regexp/no-empty-alternative": "warn",
892
+ "regexp/no-empty-capturing-group": "error",
893
+ "regexp/no-empty-character-class": "error",
894
+ "regexp/no-empty-group": "error",
895
+ "regexp/no-empty-lookarounds-assertion": "error",
896
+ "regexp/no-empty-string-literal": "error",
897
+ "regexp/no-escape-backspace": "error",
898
+ "regexp/no-extra-lookaround-assertions": "error",
899
+ "regexp/no-invalid-regexp": "error",
900
+ "regexp/no-invisible-character": "error",
901
+ "regexp/no-lazy-ends": "warn",
902
+ "regexp/no-legacy-features": "error",
903
+ "regexp/no-misleading-capturing-group": "error",
904
+ "regexp/no-misleading-unicode-character": "error",
905
+ "regexp/no-missing-g-flag": "error",
906
+ "regexp/no-non-standard-flag": "error",
907
+ "regexp/no-obscure-range": "error",
908
+ "regexp/no-optional-assertion": "error",
909
+ "regexp/no-potentially-useless-backreference": "warn",
910
+ "regexp/no-super-linear-backtracking": "error",
911
+ "regexp/no-trivially-nested-assertion": "error",
912
+ "regexp/no-trivially-nested-quantifier": "error",
913
+ "regexp/no-unused-capturing-group": "error",
914
+ "regexp/no-useless-assertions": "error",
915
+ "regexp/no-useless-backreference": "error",
916
+ "regexp/no-useless-character-class": "error",
917
+ "regexp/no-useless-dollar-replacements": "error",
918
+ "regexp/no-useless-escape": "error",
919
+ "regexp/no-useless-flag": "warn",
920
+ "regexp/no-useless-lazy": "error",
921
+ "regexp/no-useless-non-capturing-group": "error",
922
+ "regexp/no-useless-quantifier": "error",
923
+ "regexp/no-useless-range": "error",
924
+ "regexp/no-useless-set-operand": "error",
925
+ "regexp/no-useless-string-literal": "error",
926
+ "regexp/no-useless-two-nums-quantifier": "error",
927
+ "regexp/no-zero-quantifier": "error",
928
+ "regexp/optimal-lookaround-quantifier": "warn",
929
+ "regexp/optimal-quantifier-concatenation": "error",
930
+ "regexp/prefer-character-class": "error",
931
+ "regexp/prefer-d": "error",
932
+ "regexp/prefer-plus-quantifier": "error",
933
+ "regexp/prefer-predefined-assertion": "error",
934
+ "regexp/prefer-question-quantifier": "error",
935
+ "regexp/prefer-range": "error",
936
+ "regexp/prefer-set-operation": "error",
937
+ "regexp/prefer-star-quantifier": "error",
938
+ "regexp/prefer-unicode-codepoint-escapes": "error",
939
+ "regexp/prefer-w": "error",
940
+ "regexp/simplify-set-operations": "error",
941
+ "regexp/sort-flags": "error",
942
+ "regexp/strict": "error",
943
+ "regexp/use-ignore-case": "error",
879
944
  "use-isnan": [
880
945
  "error",
881
946
  {
package/oxlint/node.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "plugins": ["node"],
3
+ "jsPlugins": [
4
+ { "name": "@pob", "specifier": "../lib/oxlint-plugins/pob.js" }
5
+ ],
3
6
  "rules": {
7
+ "@pob/forbid-non-native-node-imports": "error",
4
8
  "node/no-exports-assign": "error"
5
9
  },
6
10
  "overrides": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/eslint-config",
3
- "version": "67.9.0",
3
+ "version": "67.10.0",
4
4
  "description": "eslint config files",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/christophehurpeau/pob",