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

Update dependencies and workflows #382

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
28 changes: 0 additions & 28 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '22.x'
registry-url: 'https://registry.npmjs.org/'

- name: Install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand Down
55 changes: 55 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const globals = require('globals');

const eslintJS = require('@eslint/js');
const { FlatCompat } = require('@eslint/eslintrc');

const compat = new FlatCompat({
baseDirectory: __dirname
});

module.exports = [
eslintJS.configs.recommended,
...compat.extends('eslint-config-standard'),
{
languageOptions: {
sourceType: 'script',
globals: {
...globals.browser,
...globals.node,
}
},
rules: {
'camelcase': 0,
'comma-dangle': 0,
'indent': ['error', 4],
'new-cap': 0,
'no-shadow': ['error'],
'no-var': ['error'],
'object-shorthand': ['warn', 'consistent'],
'operator-linebreak': ['error', 'after'],
'quote-props': ['error', 'consistent-as-needed'],
'semi': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
},
},
{
files: ['test/**/*.mjs'],
languageOptions: {
sourceType: 'module',
globals: {
it: 'readonly',
describe: 'readonly',
},
},
rules: {
'no-unused-expressions': 0,
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'never',
exports: 'never',
functions: 'ignore',
}],
},
},
];
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
"@babel/cli": "^7.25.6",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.4",
"chai": "^4.5.0",
"chai": "^5.1.1",
"chai-subset": "^1.6.0",
"compression-webpack-plugin": "^10.0.0",
"eslint": "^8.57.0",
"compression-webpack-plugin": "^11.1.0",
"eslint": "^9.9.1",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.6.0",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-promise": "^7.1.0",
"globals": "^15.9.0",
"mocha": "^10.7.3",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"nyc": "^17.0.0",
"shx": "^0.3.4",
"sinon": "^15.2.0",
"sinon-chai": "^3.7.0",
"sinon": "^18.0.0",
"sinon-chai": "^4.0.0",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4"
},
Expand Down
1 change: 0 additions & 1 deletion src/commands/numerics.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

/* eslint-disable quote-props */
module.exports = {
'001': 'RPL_WELCOME',
'002': 'RPL_YOURHOST',
Expand Down
12 changes: 6 additions & 6 deletions test/casefolding.js → test/casefolding.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';
/* globals describe, it */
const chai = require('chai');
const IrcClient = require('../src/client');
const expect = chai.expect;

chai.use(require('chai-subset'));
import { expect, use } from 'chai';
import chaiSubset from 'chai-subset';

import IrcClient from '../src/client.js';

use(chaiSubset);

describe('src/client.js', function() {
describe('caseLower', function() {
Expand Down Expand Up @@ -69,7 +70,6 @@ describe('src/client.js', function() {
});
});

/* eslint-disable no-unused-expressions */
describe('caseCompare', function() {
it('CASEMAPPING=rfc1459', function() {
const client = new IrcClient();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
'use strict';

/* globals describe, it */
/* eslint-disable no-unused-expressions */
const chai = require('chai');
const expect = chai.expect;
const mocks = require('../../mocks');
const sinonChai = require('sinon-chai');
const misc = require('../../../src/commands/handlers/misc');
const IrcCommand = require('../../../src/commands/command');
import { expect, use } from 'chai';
import sinonChai from 'sinon-chai';

chai.use(sinonChai);
import * as mocks from '../../mocks.mjs';

import misc from '../../../src/commands/handlers/misc.js';
import IrcCommand from '../../../src/commands/command.js';

use(sinonChai);

describe('src/commands/handlers/misc.js', function() {
describe('PING handler', function() {
Expand All @@ -18,7 +17,7 @@ describe('src/commands/handlers/misc.js', function() {
params: ['example.com'],
tags: {
time: '2021-06-29T16:42:00Z',
}
},
});
mock.handlers.PING(cmd, mock.spies);

Expand All @@ -33,8 +32,8 @@ describe('src/commands/handlers/misc.js', function() {
message: undefined,
time: 1624984920000,
tags: {
time: '2021-06-29T16:42:00Z'
}
time: '2021-06-29T16:42:00Z',
},
});
});
});
Expand All @@ -46,7 +45,7 @@ describe('src/commands/handlers/misc.js', function() {
params: ['one.example.com', 'two.example.com'],
tags: {
time: '2011-10-10T14:48:00Z',
}
},
});
mock.handlers.PONG(cmd, mock.spies);
expect(mock.spies.network.addServerTimeOffset).to.have.been.calledOnce;
Expand All @@ -55,8 +54,8 @@ describe('src/commands/handlers/misc.js', function() {
message: 'two.example.com',
time: 1318258080000,
tags: {
time: '2011-10-10T14:48:00Z'
}
time: '2011-10-10T14:48:00Z',
},
});
});
});
Expand Down
10 changes: 5 additions & 5 deletions test/helper.test.js → test/helper.test.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

/* globals describe, it */
const chai = require('chai');
const Helper = require('../src/helpers');
const expect = chai.expect;
import { expect, use } from 'chai';
import chaiSubset from 'chai-subset';

chai.use(require('chai-subset'));
import Helper from '../src/helpers.js';

use(chaiSubset);

describe('src/irclineparser.js', function() {
describe('mask parsing', function() {
Expand Down
Loading