Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] eslint 9 compatibility #194

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
407 changes: 0 additions & 407 deletions base.js

This file was deleted.

5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import baseConfig from "./src/rules/base.js";

export default {
...baseConfig,
};
38 changes: 0 additions & 38 deletions node.js

This file was deleted.

2,800 changes: 1,256 additions & 1,544 deletions package-lock.json

Large diffs are not rendered by default.

53 changes: 29 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"name": "eslint-config-peerigon",
"version": "0.0.0-semantically-released",
"description": "Peerigon coding rules as eslint config",
"main": "base.js",
"type": "module",
"exports": {
".": "./src/rulesets/base.js",
"./*": "./src/*.js"
},
"scripts": {
"unused": "eslint-find-rules -u -n -d",
"unused:javascript": "npm run unused -- ./tests/javascript/.eslintrc.json",
Expand All @@ -20,7 +24,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/peerigon/eslint-config-peerigon.git"
"url": "git+https://github.com/peerigon/eslint-config-peerigon.git"
},
"keywords": [
"eslint",
Expand All @@ -30,9 +34,7 @@
"style"
],
"files": [
"*.js",
"styles",
"presets"
"src"
],
"author": "Peerigon GmbH <[email protected]>",
"license": "Unlicense",
Expand All @@ -41,44 +43,47 @@
},
"homepage": "https://github.com/peerigon/eslint-config-peerigon#readme",
"peerDependencies": {
"eslint": "^8.1.0"
"eslint": "^9.1.1"
},
"dependencies": {
"@babel/core": "^7.24.4",
"@babel/eslint-parser": "^7.24.1",
"@babel/eslint-plugin": "^7.23.5",
"@babel/core": "^7.24.5",
"@babel/eslint-parser": "^7.24.5",
"@babel/eslint-plugin": "^7.24.5",
"@eslint/js": "^9.1.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-no-unsafe-regex": "^1.0.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-n": "^17.4.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-optimize-regex": "^1.2.1",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-promise": "^6.1.1"
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.2",
"globals": "^15.1.0",
"typescript-eslint": "^7.8.0"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-syntax-import-attributes": "^7.24.1",
"@babel/preset-env": "^7.24.4",
"@babel/preset-env": "^7.24.5",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/react": "^18.2.69",
"eslint": "^8.57.0",
"@tsconfig/strictest": "^2.0.5",
"@types/eslint": "^8.56.10",
"@types/eslint__js": "^8.42.3",
"@types/react": "^18.3.1",
"eslint": "^9.1.1",
"eslint-find-rules": "^4.1.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"npm-run-all": "^4.1.5",
"pin-github-action": "^1.9.1",
"prettier": "^3.2.5",
"react": "^18.2.0",
"semantic-release": "^23.0.5",
"typescript": "^5.4.3"
"react": "^18.3.1",
"semantic-release": "^23.0.8",
"typescript": "^5.4.5"
},
"lint-staged": {
".github/workflows/*.{yml,yaml}": [
Expand Down
4 changes: 2 additions & 2 deletions glob-patterns.js → src/glob-patterns.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
/*eslint sort-keys: ["error", "asc"]*/

module.exports = {
export const globPatterns = {
tests: ["**/*.{test,spec,stories}.*", "**/test{s,}/**"],
tooling: [
"config/**",
Expand Down
15 changes: 15 additions & 0 deletions src/globals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import globals from "globals";

export { globals };

/**
* @template Item
* @param {Array<Item>} a
* @param {Array<Item>} b
* @returns {Array<Item>}
*/
const intersect = (a, b) => {
const setOfB = new Set(b);

return a.filter((x) => setOfB.has(x));
};
5 changes: 3 additions & 2 deletions options.js → src/options.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"use strict";
/* eslint sort-keys: ["error", "asc"] */
/* eslint-disable sort-keys */

const camelcase = {
allow: ["^UNSAFE_"], // Allows React UNSAFE_ methods
ignoreDestructuring: false,
properties: "always",
};

module.exports = {
export const options = {
/* eslint-enable sort-keys */
["camelcase"]: camelcase,
["max-lines"]: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint sort-keys: ["error", "asc"] */
/* eslint-disable sort-keys */

module.exports = {
export default {
extends: [
"peerigon",
"peerigon/typescript",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint sort-keys: ["error", "asc"] */
/* eslint-disable sort-keys */

module.exports = {
export default {
extends: [
"peerigon",
"peerigon/typescript",
Expand Down
2 changes: 1 addition & 1 deletion presets/typescript.js → src/presets/typescript.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint sort-keys: ["error", "asc"] */
/* eslint-disable sort-keys */

module.exports = {
export default {
extends: [
"peerigon",
"peerigon/typescript",
Expand Down
Loading