Skip to content
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, 24.x]

steps:
- uses: actions/checkout@v4
Expand Down
61 changes: 61 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
'use strict';

const globals = require('globals');
const eslintJS = require('@eslint/js');

module.exports = [
eslintJS.configs.recommended,
{
languageOptions: {
sourceType: 'commonjs',
globals: {
...globals.browser,
...globals.node,
}
},
rules: {
'indent': ['error', 4],
'no-shadow': ['error'],
'no-var': ['error'],
'no-unused-vars': ['error', {
vars: 'all',
args: 'none',
caughtErrors: 'none',
ignoreRestSiblings: false,
ignoreUsingDeclarations: false,
reportUsedIgnorePattern: false,
}],
'object-shorthand': ['warn', 'consistent'],
'quote-props': ['error', 'consistent-as-needed'],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'strict': ['error', 'safe']
},
},
{
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',
}],
},
},
{
files: ['examples/**/*.js'],
rules: {
strict: 0,
},
},
];
49 changes: 25 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,36 @@
"browser": "dist/browser/src/",
"dependencies": {
"buffer": "^6.0.3",
"core-js": "^3.38.1",
"eventemitter3": "^5.0.1",
"core-js": "^3.48.0",
"eventemitter3": "^5.0.4",
"grapheme-splitter": "^1.0.4",
"iconv-lite": "^0.6.3",
"iconv-lite": "^0.7.2",
"isomorphic-textencoder": "^1.0.1",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"middleware-handler": "^0.2.0",
"regenerator-runtime": "^0.14.1",
"socks": "^2.8.3",
"socks": "^2.8.7",
"stream-browserify": "^3.0.0",
"util": "^0.12.5"
},
"devDependencies": {
"@babel/cli": "^7.25.6",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.4",
"chai": "^4.5.0",
"@babel/cli": "^7.28.6",
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.0",
"@eslint/js": "^9.39.2",
"chai": "^6.2.2",
"chai-subset": "^1.6.0",
"compression-webpack-plugin": "^10.0.0",
"eslint": "^8.57.0",
"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",
"mocha": "^10.7.3",
"compression-webpack-plugin": "^11.1.0",
"eslint": "^9.39.2",
"globals": "^17.3.0",
"mocha": "^11.7.5",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"shx": "^0.3.4",
"sinon": "^15.2.0",
"sinon-chai": "^3.7.0",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4"
"nyc": "^17.1.0",
"shx": "^0.4.0",
"sinon": "^21.0.1",
"sinon-chai": "^4.0.1",
"webpack": "^5.105.2",
"webpack-cli": "^6.0.1"
},
"scripts": {
"test": "npm-run-all lint coverage",
Expand All @@ -64,5 +61,9 @@
"bugs": {
"url": "https://github.com/kiwiirc/irc-framework/issues"
},
"homepage": "https://github.com/kiwiirc/irc-framework#readme"
"homepage": "https://github.com/kiwiirc/irc-framework#readme",
"engines": {
"node": ">= 18.18"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
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
2 changes: 2 additions & 0 deletions src/ircmessage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const MessageTags = require('./messagetags');

module.exports = class IrcMessage {
Expand Down
2 changes: 2 additions & 0 deletions src/linebreak.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const GraphemeSplitter = require('grapheme-splitter');
const { encode: encodeUTF8 } = require('isomorphic-textencoder');

Expand Down
12 changes: 5 additions & 7 deletions test/casefolding.js → test/casefolding.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
'use strict';
/* globals describe, it */
const chai = require('chai');
const IrcClient = require('../src/client');
const expect = chai.expect;
import { expect, use } from 'chai';
import chaiSubset from 'chai-subset';

chai.use(require('chai-subset'));
import IrcClient from '../src/client.js';

use(chaiSubset);

describe('src/client.js', function() {
describe('caseLower', function() {
Expand Down Expand Up @@ -69,7 +68,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,12 @@
'use strict';
import { expect, use } from 'chai';
import sinonChai from 'sinon-chai';

/* 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 * as mocks from '../../mocks.mjs';

chai.use(sinonChai);
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 +15,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 +30,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 +43,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 +52,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: 4 additions & 6 deletions test/helper.test.js → test/helper.test.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
'use strict';
import { expect, use } from 'chai';
import chaiSubset from 'chai-subset';

/* globals describe, it */
const chai = require('chai');
const Helper = require('../src/helpers');
const expect = chai.expect;
import Helper from '../src/helpers.js';

chai.use(require('chai-subset'));
use(chaiSubset);

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