Skip to content
Merged
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
16 changes: 14 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,23 @@ on:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 22.x
cache: 'npm'
- run: npm install
- run: npm run lint

unit:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
node-version: [18.x, 20.x, 22.x, '24.x']
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -35,7 +47,7 @@ jobs:
- run: npm install
- name: Run coverage
run: |
npm run build
npm run build:ci
npm run test:coverage
- name: Run browser tests
if: ${{ github.secret_source == 'Actions' }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ node_modules
# Build files
build
!test/qunit/build
test/qunit/vendor
dist
lib
vendor
Expand Down
4 changes: 2 additions & 2 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ignore:
- 'test/qunit/*'
- 'test/conf.js'
- 'test/*.conf.js'
- 'test/conf.cjs'
- 'test/*.conf.cjs'
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Linkify is built and tested in the command line with `npm` scripts. Build tasks
npm run build
```

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.
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.

### Running tests

Expand Down
115 changes: 56 additions & 59 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,67 @@ import mocha from 'eslint-plugin-mocha';
import babel from '@babel/eslint-plugin';
import globals from 'globals';
import babelParser from '@babel/eslint-parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [
js.configs.recommended,
mocha.configs.recommended,
{
ignores: [
'**/.DS_Store',
'**/.env',
'**/.env.*',
'!**/.env.example',
'**/_sass',
'**/_site',
'**/coverage',
'**/node_modules',
'**/package-lock.json',
'dist/*',
'packages/*/dist/*',
'test/qunit/vendor/*',
],
},
{
plugins: {
'@babel': babel,
},

export default [{
ignores: [
'**/.DS_Store',
'**/_sass',
'**/_site',
'**/coverage',
'dist/*',
'**/node_modules',
'**/package-lock.json',
'packages/*/dist/*',
'**/.env',
'**/.env.*',
'!**/.env.example',
],
}, ...compat.extends('eslint:recommended', 'plugin:mocha/recommended'), {
plugins: {
mocha,
'@babel': babel,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jquery,
...globals.amd,
...globals.mocha,
__base: false,
expect: false,
},

languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jquery,
...globals.amd,
...globals.mocha,
__base: false,
expect: false,
},
parser: babelParser,
ecmaVersion: 6,
sourceType: 'module',

parser: babelParser,
ecmaVersion: 6,
sourceType: 'module',
parserOptions: {
requireConfigFile: false,
},
},

parserOptions: {
requireConfigFile: false,
},
},
rules: {
curly: 2,
eqeqeq: ['error', 'smart'],
quotes: [2, 'single', 'avoid-escape'],
semi: 2,

rules: {
curly: 2,
eqeqeq: ['error', 'smart'],
quotes: [2, 'single', 'avoid-escape'],
semi: 2,
'no-unused-vars': [
'error',
{
caughtErrors: 'none',
varsIgnorePattern: 'should|expect',
},
],

'no-unused-vars': ['error', {
caughtErrors: 'none',
varsIgnorePattern: 'should|expect',
}],

'mocha/no-mocha-arrows': 0,
},
}];
'mocha/no-mocha-arrows': 0,
},
},
];
Loading