Skip to content

Commit 359ed4e

Browse files
authored
Update dependencies (#513)
* Update to latest dependencies * Fix eslint config * Slightly more future proof react config React 19 stubbornly doesn't work with tests yet, but the plugin itself probably works fine * CI fix * Fix mocha test error * Additional test fixes * Update lint settings * Add proper lint step
1 parent c4bdf85 commit 359ed4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3076
-2018
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,23 @@ on:
88
branches: [main]
99

1010
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 22.x
18+
cache: 'npm'
19+
- run: npm install
20+
- run: npm run lint
21+
1122
unit:
23+
needs: lint
1224
runs-on: ubuntu-latest
1325
strategy:
1426
matrix:
15-
node-version: [18.x, 20.x, 22.x]
27+
node-version: [18.x, 20.x, 22.x, '24.x']
1628
steps:
1729
- uses: actions/checkout@v3
1830
- name: Use Node.js ${{ matrix.node-version }}
@@ -35,7 +47,7 @@ jobs:
3547
- run: npm install
3648
- name: Run coverage
3749
run: |
38-
npm run build
50+
npm run build:ci
3951
npm run test:coverage
4052
- name: Run browser tests
4153
if: ${{ github.secret_source == 'Actions' }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ node_modules
4040
# Build files
4141
build
4242
!test/qunit/build
43+
test/qunit/vendor
4344
dist
4445
lib
4546
vendor

.mocharc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ignore:
22
- 'test/qunit/*'
3-
- 'test/conf.js'
4-
- 'test/*.conf.js'
3+
- 'test/conf.cjs'
4+
- 'test/*.conf.cjs'

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Linkify is built and tested in the command line with `npm` scripts. Build tasks
5050
npm run build
5151
```
5252

53-
This transpiles ES6 to ES5 (via [Babel](http://babeljs.io/)) from `src/` into `dist/`. The Node.js modules have a `.cjs.js` extension. The dist folder is published to [NPM](https://www.npmjs.com/). Also generates browser-ready scripts (classic globals with `.js` and `.min.js` extensions, and ES modules with `.es.js` extensions) into the `dist/` folder.
53+
This transpiles ES6 to ES5 (via [Babel](http://babeljs.io/)) from `src/` into `dist/`. The Node.js modules have a `.cjs` extension. The dist folder is published to [NPM](https://www.npmjs.com/). Also generates browser-ready scripts (classic globals with `.js` and `.min.js` extensions, and ES modules with `.mjs` extensions) into the `dist/` folder.
5454

5555
### Running tests
5656

eslint.config.mjs

Lines changed: 56 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,70 +2,67 @@ import mocha from 'eslint-plugin-mocha';
22
import babel from '@babel/eslint-plugin';
33
import globals from 'globals';
44
import babelParser from '@babel/eslint-parser';
5-
import path from 'node:path';
6-
import { fileURLToPath } from 'node:url';
75
import js from '@eslint/js';
8-
import { FlatCompat } from '@eslint/eslintrc';
96

10-
const __filename = fileURLToPath(import.meta.url);
11-
const __dirname = path.dirname(__filename);
12-
const compat = new FlatCompat({
13-
baseDirectory: __dirname,
14-
recommendedConfig: js.configs.recommended,
15-
allConfig: js.configs.all
16-
});
7+
export default [
8+
js.configs.recommended,
9+
mocha.configs.recommended,
10+
{
11+
ignores: [
12+
'**/.DS_Store',
13+
'**/.env',
14+
'**/.env.*',
15+
'!**/.env.example',
16+
'**/_sass',
17+
'**/_site',
18+
'**/coverage',
19+
'**/node_modules',
20+
'**/package-lock.json',
21+
'dist/*',
22+
'packages/*/dist/*',
23+
'test/qunit/vendor/*',
24+
],
25+
},
26+
{
27+
plugins: {
28+
'@babel': babel,
29+
},
1730

18-
export default [{
19-
ignores: [
20-
'**/.DS_Store',
21-
'**/_sass',
22-
'**/_site',
23-
'**/coverage',
24-
'dist/*',
25-
'**/node_modules',
26-
'**/package-lock.json',
27-
'packages/*/dist/*',
28-
'**/.env',
29-
'**/.env.*',
30-
'!**/.env.example',
31-
],
32-
}, ...compat.extends('eslint:recommended', 'plugin:mocha/recommended'), {
33-
plugins: {
34-
mocha,
35-
'@babel': babel,
36-
},
31+
languageOptions: {
32+
globals: {
33+
...globals.browser,
34+
...globals.node,
35+
...globals.jquery,
36+
...globals.amd,
37+
...globals.mocha,
38+
__base: false,
39+
expect: false,
40+
},
3741

38-
languageOptions: {
39-
globals: {
40-
...globals.browser,
41-
...globals.node,
42-
...globals.jquery,
43-
...globals.amd,
44-
...globals.mocha,
45-
__base: false,
46-
expect: false,
47-
},
42+
parser: babelParser,
43+
ecmaVersion: 6,
44+
sourceType: 'module',
4845

49-
parser: babelParser,
50-
ecmaVersion: 6,
51-
sourceType: 'module',
46+
parserOptions: {
47+
requireConfigFile: false,
48+
},
49+
},
5250

53-
parserOptions: {
54-
requireConfigFile: false,
55-
},
56-
},
51+
rules: {
52+
curly: 2,
53+
eqeqeq: ['error', 'smart'],
54+
quotes: [2, 'single', 'avoid-escape'],
55+
semi: 2,
5756

58-
rules: {
59-
curly: 2,
60-
eqeqeq: ['error', 'smart'],
61-
quotes: [2, 'single', 'avoid-escape'],
62-
semi: 2,
57+
'no-unused-vars': [
58+
'error',
59+
{
60+
caughtErrors: 'none',
61+
varsIgnorePattern: 'should|expect',
62+
},
63+
],
6364

64-
'no-unused-vars': ['error', {
65-
caughtErrors: 'none',
66-
varsIgnorePattern: 'should|expect',
67-
}],
68-
69-
'mocha/no-mocha-arrows': 0,
70-
},
71-
}];
65+
'mocha/no-mocha-arrows': 0,
66+
},
67+
},
68+
];

0 commit comments

Comments
 (0)