Skip to content

Commit

Permalink
chore(deps): update dependency eslint-plugin-unicorn to v56 (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored Nov 19, 2024
1 parent f5502bd commit fa22b4c
Show file tree
Hide file tree
Showing 12 changed files with 153 additions and 68 deletions.
2 changes: 2 additions & 0 deletions @pob/eslint-config/lib/_base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import js from "@eslint/js";
import pobPlugin from "@pob/eslint-plugin";
import regexpPluginConfigs from "./plugins/regexp.js";
import unicornPluginConfigs from "./plugins/unicorn.js";
import bestPracticesConfig from "./rules/best-practices.js";
import codeQualityConfig from "./rules/code-quality.js";
Expand Down Expand Up @@ -30,6 +31,7 @@ export default [
js.configs.recommended,
pobPlugin.configs.base,
...unicornPluginConfigs,
...regexpPluginConfigs,
bestPracticesConfig,
codeQualityConfig,
errorsConfig,
Expand Down
9 changes: 9 additions & 0 deletions @pob/eslint-config/lib/plugins/regexp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import eslintPluginRegexp from "eslint-plugin-regexp";

export default [
eslintPluginRegexp.configs["flat/recommended"],
{
name: "@pob/eslint-config/regexp",
rules: {},
},
];
12 changes: 9 additions & 3 deletions @pob/eslint-config/lib/plugins/unicorn.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ export default [
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
"unicorn/new-for-builtins": "error",

// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md
"unicorn/better-regex": "error",

// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md
"unicorn/prefer-spread": "error",

Expand Down Expand Up @@ -339,6 +336,15 @@ export default [

// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md
"unicorn/prefer-blob-reading-methods": "error",

// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-global-this.md
"unicorn/prefer-global-this": "warn",

// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-min-max.md
"unicorn/prefer-math-min-max": "error",

// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-existence-index-check.md
"unicorn/consistent-existence-index-check": "error",
},
},
{
Expand Down
6 changes: 4 additions & 2 deletions @pob/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@
"confusing-browser-globals": "^1.0.11",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.4.0",
"eslint-plugin-unicorn": "^55.0.0"
"eslint-plugin-regexp": "^2.7.0",
"eslint-plugin-unicorn": "^56.0.0"
},
"devDependencies": {
"eslint": "9.14.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "17.4.0",
"eslint-plugin-unicorn": "55.0.0",
"eslint-plugin-regexp": "2.7.0",
"eslint-plugin-unicorn": "56.0.0",
"typescript": "5.6.3"
}
}
2 changes: 1 addition & 1 deletion @pob/eslint-config/test-lint/errors/no-control-regex.mjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// eslint-disable-next-line no-control-regex
// eslint-disable-next-line no-control-regex, regexp/control-character-escape
export const pattern1 = /\u0000/;
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// eslint-disable-next-line no-empty-character-class
// eslint-disable-next-line no-empty-character-class, regexp/no-empty-character-class
/^abc[]/.test("abcdefg"); // false
4 changes: 2 additions & 2 deletions @pob/eslint-config/test-lint/errors/no-invalid-regexp.mjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// eslint-disable-next-line no-invalid-regexp, prefer-regex-literals, unicorn/new-for-builtins
RegExp("[");
// eslint-disable-next-line no-invalid-regexp, prefer-regex-literals, regexp/no-invalid-regexp
export const regexp = new RegExp("[");
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// eslint-disable-next-line no-misleading-character-class
// eslint-disable-next-line no-misleading-character-class, regexp/no-misleading-unicode-character
/^[👶🏻]$/u.test("👶🏻"); // → false
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// eslint-disable-next-line no-useless-backreference
// eslint-disable-next-line no-useless-backreference, regexp/no-useless-backreference
export const r = /^(?:(a)|\1b)$/; // reference to (a) into another alternative
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// eslint-disable-next-line regexp/no-contradiction-with-assertion
export const foo1 = /(?=a)(\w|-)/;
// eslint-disable-next-line regexp/no-contradiction-with-assertion
export const foo2 = /(?=a)b*a/;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"eslint-plugin-n": "17.4.0",
"eslint-plugin-react": "7.35.2",
"eslint-plugin-react-hooks": "5.0.0",
"eslint-plugin-unicorn": "55.0.0",
"eslint-plugin-unicorn": "56.0.0",
"semver": "7.6.3",
"typescript": "5.6.3"
}
Expand Down
Loading

0 comments on commit fa22b4c

Please sign in to comment.