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

Bump the eslint group across 1 directory with 4 updates #44

Merged
merged 2 commits into from
Oct 17, 2024
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
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

67 changes: 0 additions & 67 deletions .eslintrc.json

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ name: 'CI'
on: [pull_request, push]

jobs:
lint:
runs-on: ubuntu-latest
name: Lint

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint


swig:
runs-on: ubuntu-latest
name: Generate the SWIG wrappers
Expand Down
80 changes: 80 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import mocha from 'eslint-plugin-mocha';
import globals from 'globals';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-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 [{
ignores: ['test/browser/build/*', 'build/*', 'lib/binding/*'],
}, ...compat.extends('eslint:recommended'), {
plugins: {
mocha,
},

languageOptions: {
globals: {
...globals.mocha,
...globals['shared-node-browser'],
__karma__: true,
process: true,
},

ecmaVersion: 2020,
sourceType: 'module',
},

rules: {
semi: [2, 'always'],
quotes: ['error', 'single'],
},
}, ...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
).map(config => ({
...config,
files: ['test/*.ts'],
})), {
files: ['test/*.ts'],

plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
parser: tsParser,
},

rules: {
'@typescript-eslint/ban-ts-comment': 'off',
},
}, {
files: ['**/*.cjs'],

languageOptions: {
ecmaVersion: 2015,
sourceType: 'commonjs',
globals: {
...globals.node
}
},
}, {
files: ['test/browser/*.js'],

languageOptions: {
globals: {
...globals.browser,
},
},
}];
Loading
Loading