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 eslint, fix linting issues and upgrade dependencies #125

Merged
merged 11 commits into from
Jan 21, 2025
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

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

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint

on:
pull_request: {}

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint
47 changes: 47 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import eslintConfig from '@pretendonetwork/eslint-config';
import globals from 'globals';

export default [
...eslintConfig,
{
// Allow browser globals in webfiles
languageOptions: {
globals: {
...globals.browser,
Pjax: false // loaded from pjax.min.js
}
},
files: ['src/webfiles/**/*.js']
},
{
// Rules that apply to the 3DS (CTR) and Wii U (Portal) browsers
files: ['src/webfiles/ctr/**/*.js', 'src/webfiles/portal/**/*.js'],
rules: {
'no-var': 'off' // 3DS and Wii U browsers need to use var
},
languageOptions: {
globals: {
...globals.browser,
wiiuBrowser: 'readonly',
wiiuSound: 'readonly',
wiiuMainApplication: 'readonly',
wiiuErrorViewer: 'readonly',
wiiuMemo: 'readonly',
wiiuDialog: 'readonly',
wiiu: 'readonly',
cave: 'readonly',
Olv: 'readonly'
}
}
},
{
// Add node.js globals to files outside of the webfiles directory
languageOptions: {
globals: {
...globals.node,
...globals.builtin
}
},
ignores: ['src/webfiles/**/*.js']
}
];
Loading
Loading