Skip to content

Commit 2a3ef51

Browse files
chore(deps): update
1 parent 6e60b65 commit 2a3ef51

37 files changed

+6920
-15390
lines changed

.github/workflows/ci.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
strategy:
2222
matrix:
23-
node: [14]
23+
node: [18]
2424
os: [ubuntu-latest]
2525

2626
steps:
@@ -51,19 +51,17 @@ jobs:
5151
strategy:
5252
fail-fast: false
5353
matrix:
54-
node: [14, 16, 18]
54+
node: [18, 20, 22]
5555
os: [ubuntu-latest, windows-latest, macos-latest]
5656

5757
steps:
58-
- uses: actions/checkout@v2
58+
- uses: actions/checkout@v4
5959

6060
- name: Use Node.js ${{ matrix.node }}
61-
uses: actions/setup-node@v1
61+
uses: actions/setup-node@v4
6262
with:
6363
node-version: ${{ matrix.node }}
64-
65-
- name: Install latest npm
66-
run: npm install --global npm@latest
64+
cache: "npm"
6765

6866
- name: Install dependencies
6967
run: npm ci

README.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
[![NPM version](https://img.shields.io/npm/v/eslint-plugin-itgalaxy.svg)](https://www.npmjs.org/package/eslint-plugin-itgalaxy)
44
[![Build Status](https://github.com/itgalaxy/eslint-plugin-itgalaxy/workflows/CI/badge.svg)](https://github.com/itgalaxy/eslint-plugin-itgalaxy/actions)
5-
[![dependencies Status](https://david-dm.org/itgalaxy/eslint-plugin-itgalaxy/status.svg)](https://david-dm.org/itgalaxy/eslint-plugin-itgalaxy)
6-
[![devDependencies Status](https://david-dm.org/itgalaxy/eslint-plugin-itgalaxy/dev-status.svg)](https://david-dm.org/itgalaxy/eslint-plugin-itgalaxy?type=dev)
7-
[![peerDependencies Status](https://david-dm.org/itgalaxy/eslint-plugin-itgalaxy/peer-status.svg)](https://david-dm.org/itgalaxy/eslint-plugin-itgalaxy?type=peer)
85

96
Itgalaxy’s ESLint rules and configs.
107

@@ -128,7 +125,6 @@ import eslint from "eslint";
128125
* @returns {object} Config
129126
*/
130127
function loadConfig(configName) {
131-
// eslint-disable-next-line import/no-dynamic-require
132128
return require(`my-${configName}`);
133129
}
134130

__tests__/fixtures/ava.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line import/no-unresolved
12
import test from "ava";
23

34
test("foo", (t) => {

__tests__/fixtures/good.js

+14-17
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ function getKey(prefix = "", key = null) {
2323
let realKey = key || null;
2424

2525
if (!realKey) {
26-
realKey = Object.prototype.hasOwnProperty.call(
27-
{ key: "key", value: "value" },
28-
"key"
29-
)
26+
realKey = Object.hasOwn({ key: "key", value: "value" }, "key")
3027
? "very very very very very very very very very long key"
3128
: 1;
3229
}
@@ -75,7 +72,7 @@ const objectVariable = {
7572
// defer: deferFn((config) => (config.exist ? 'exist' : 'non exist'))
7673
};
7774

78-
objectVariable.log = function (items, options = {}) {
75+
objectVariable.log = function log(items, options = {}) {
7976
const concatenateAll = (...args) => args.join("").join(Object.keys(options));
8077

8178
return concatenateAll(this.addValue(1).addValue(items), options);
@@ -103,7 +100,7 @@ const obj = {
103100

104101
console.log(obj);
105102

106-
const has = Object.prototype.hasOwnProperty;
103+
const has = Object.hasOwn;
107104

108105
handler();
109106
handler();
@@ -186,7 +183,7 @@ switch (letVariable) {
186183

187184
arrayVariable.push(letVariable);
188185

189-
Object.prototype.hasOwnProperty.call(objectVariable, "id");
186+
Object.hasOwn(objectVariable, "id");
190187
has.call(objectVariable, "id");
191188

192189
const itemsCopy = [...arrayVariable];
@@ -310,7 +307,7 @@ if (booleanVariable) {
310307
[1, 2, 3].map(
311308
(number) =>
312309
`As time went by, the string containing the ${number} became much ` +
313-
"longer. So we needed to break it over multiple lines."
310+
"longer. So we needed to break it over multiple lines.",
314311
);
315312

316313
const itemHeightFoo = (item) => {
@@ -359,9 +356,9 @@ handler();
359356

360357
try {
361358
render();
362-
} catch (error) {
359+
} catch (err) {
363360
render({
364-
error,
361+
err,
365362
});
366363
}
367364

@@ -389,10 +386,10 @@ async function fetchJson(url) {
389386
const text = await request.text();
390387

391388
return JSON.parse(text);
392-
} catch (error) {
389+
} catch (err) {
393390
multiply(2, 1, 2, 3);
394391

395-
throw error;
392+
throw err;
396393
}
397394
}
398395

@@ -595,12 +592,12 @@ Promise.all([Promise.resolve("a"), "b", Promise.resolve("c")])
595592

596593
return 1;
597594
})
598-
.catch((error) => {
599-
throw error;
595+
.catch((err) => {
596+
throw err;
600597
})
601-
.then(() => Promise.race([Promise.resolve("c")]))
602-
.catch((error) => {
603-
throw error;
598+
.then(() => Promise.race([Promise.resolve("c"), Promise.resolve("d")]))
599+
.catch((err) => {
600+
throw err;
604601
});
605602

606603
class Base {

__tests__/fixtures/jsdoc-typescript.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* Description
3-
*
43
* @param {number} a Number
54
* @param {number} b Number
65
* @returns {number} Sum of numbers
@@ -63,12 +62,11 @@ const var9 = { a: "str", b: 1 };
6362

6463
/**
6564
* A map-like object that maps arbitrary `string` properties to `number`s.
66-
*
67-
* @type {Object<string, number>}
65+
* @type {{[key: string]: number}}
6866
*/
6967
const stringToNumber = { test: 123 };
7068

71-
/** @type {Object<number, object>} */
69+
/** @type {{[key: number]: object}} */
7270
const arrayLike = [];
7371

7472
arrayLike[1] = { foo: "bar" };
@@ -109,7 +107,7 @@ const JSDocState = {
109107
* @param {string} p1 A string param.
110108
* @param {string} [p2] p2 An optional param (Closure syntax)
111109
* @param {string} [p3] Another optional param (JSDoc syntax).
112-
* @param {string} [p4="test"] An optional param with a default value
110+
* @param {string} [p4] An optional param with a default value
113111
* @returns {string} This is the result
114112
*/
115113
function stringsStringStrings(p1, p2, p3, p4 = "test") {

__tests__/fixtures/node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
const http = require("http");
3+
const http = require("node:http");
44

55
const hostname = "127.0.0.1";
66
const port = 3000;

__tests__/fixtures/react/App.jsx

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import React from "react";
2-
import ReactDOM from "react-dom";
1+
import { createRoot, Component } from "react-dom/client";
32
import SearchProfile from "./SearchProfile.jsx";
43
import Profile from "./Profile.jsx";
54
import "./app.scss";
65

7-
class App extends React.Component {
6+
class App extends Component {
87
constructor(props) {
98
super(props);
109

@@ -43,4 +42,7 @@ class App extends React.Component {
4342
}
4443
}
4544

46-
ReactDOM.render(<App />, document.body);
45+
const container = document.querySelector("#app");
46+
const root = createRoot(container); // createRoot(container!) if you use TypeScript
47+
48+
root.render(<App />);

0 commit comments

Comments
 (0)