Skip to content

Commit

Permalink
deps(eslint) upgrade dependencies for eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Oct 22, 2024
1 parent 0c19663 commit 4fc5e34
Show file tree
Hide file tree
Showing 6 changed files with 1,286 additions and 1,198 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

6 changes: 4 additions & 2 deletions benchmark/benchmark.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Benchmark from "benchmark";
import { ESLint } from "eslint";
import fs from "fs";
import parser from "@typescript-eslint/parser";

// Save the contents of our old pkg json to a variable
const packageJSON = JSON.parse(fs.readFileSync("./package.json", "utf8").toString());
Expand All @@ -11,8 +12,9 @@ process.on("uncaughtException", () => {
const config = {
baseConfig: {
root: true,
parser: "@typescript-eslint/parser",
extends: ["plugin:eslint-plugin/recommended", "plugin:prettier/recommended"],
languageOptions: {
parser,
},
env: {
browser: true,
},
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"repository": "[email protected]:JonasBa/eslint-plugin-no-lookahead-lookbehind-regexp.git",
"author": "JonasBa <[email protected]>",
"author": "JonasBa",
"license": "MIT",
"dependencies": {
"browserslist": "^4.18.1",
"caniuse-lite": "^1.0.30001283"
"browserslist": "^4.24.2",
"caniuse-lite": "^1.0.30001669"
},
"scripts": {
"benchmark": "ts-node test/benchmark.ts",
"benchmark": "ts-node benchmark/benchmark.ts",
"build": "rm -rf ./lib && yarn tsc",
"tsc": "tsc",
"test": "jest",
Expand All @@ -20,22 +20,22 @@
"devDependencies": {
"@types/benchmark": "^2.1.1",
"@types/browserslist": "^4.15.0",
"@types/caniuse-lite": "^1.0.1",
"@types/eslint": "^8.2.0",
"@types/jest": "^27.0.3",
"@types/caniuse-lite": "^1.0.5",
"@types/eslint": "^9.6.1",
"@types/jest": "^29.5.13",
"@typescript-eslint/parser": "^5.4.0",
"benchmark": "^2.1.4",
"eslint": "^8.3.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-eslint-plugin": "^4.0.2",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.3.1",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-plugin": "^6.2.0",
"eslint-plugin-prettier": "^5.2.1",
"jest": "^29.7.0",
"prettier": "^2.5.0",
"ts-jest": "^27.0.7",
"ts-jest": "^29.2.5",
"ts-node": "^10.4.0",
"typescript": "^4.5.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"eslint": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
"eslint": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0"
}
}
10 changes: 6 additions & 4 deletions src/rules/noLookAheadLookBehindRegExp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { noLookaheadLookbehindRegexp } from "./noLookaheadLookbehindRegex";

// Rule tester for when no browserslist is passed, so lookahead and lookbehind should not be allowed
const tester = new RuleTester({
parser: require.resolve("@typescript-eslint/parser"),
parserOptions: {
ecmaFeatures: {
jsx: true,
languageOptions: {
parser: require("@typescript-eslint/parser"),
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
});
Expand Down
33 changes: 33 additions & 0 deletions src/rules/noLookaheadLookbehindRegex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,39 @@ const noLookaheadLookbehindRegexp: Rule.RuleModule = {
category: "Compatibility",
recommended: true,
},
schema: {
type: "array",
items: [
{
oneOf: [
{
type: "string",
enum: ["off", "warn", "error"],
},
{
type: "string",
enum: [
"no-lookahead",
"no-lookbehind",
"no-negative-lookahead",
"no-negative-lookbehind",
],
},
{
type: "object",
properties: {
browserslist: {
type: "boolean",
},
},
additionalProperties: false,
},
],
},
],
minItems: 0,
maxItems: 6,
},
type: "problem",
},
create(context: Rule.RuleContext) {
Expand Down
Loading

0 comments on commit 4fc5e34

Please sign in to comment.