mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2026-02-06 11:17:36 +00:00
Add ESLint configuration and related files; update .gitignore and package.json
This commit is contained in:
parent
478a3849ec
commit
d81fd3c0f6
27
.github/workflows/eslint.yml
vendored
Normal file
27
.github/workflows/eslint.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
name: ESLint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
eslint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run ESLint
|
||||
run: npx eslint . --max-warnings 0
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,6 +11,8 @@ data/cores/*
|
||||
!data/cores/.npmignore
|
||||
.DS_Store
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/extensions.json
|
||||
*.tgz
|
||||
dist/
|
||||
jsdoc/
|
||||
|
||||
5
.vscode/extensions.json
vendored
Normal file
5
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"dbaeumer.vscode-eslint"
|
||||
]
|
||||
}
|
||||
8
.vscode/settings.json
vendored
Normal file
8
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"diffEditor.ignoreTrimWhitespace": false,
|
||||
"editor.formatOnPaste": false,
|
||||
"editor.formatOnSave": false,
|
||||
"editor.formatOnSaveMode": "modifications",
|
||||
"eslint.enable": true,
|
||||
"eslint.lintTask.enable": true
|
||||
}
|
||||
23
eslint.config.js
Normal file
23
eslint.config.js
Normal file
@ -0,0 +1,23 @@
|
||||
export default [
|
||||
{
|
||||
files: ["**/*.js"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
sourceType: "module",
|
||||
globals: {
|
||||
console: "readonly",
|
||||
window: "readonly",
|
||||
document: "readonly",
|
||||
navigator: "readonly",
|
||||
fetch: "readonly",
|
||||
localStorage: "readonly",
|
||||
sessionStorage: "readonly"
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
"no-var": "warn",
|
||||
"prefer-const": "warn",
|
||||
"prefer-arrow-callback": "warn"
|
||||
}
|
||||
}
|
||||
];
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"target": "ES2022"
|
||||
"target": "ES2020"
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
"@emulatorjs/cores": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^9.39.2",
|
||||
"jsdoc": "^4.0.4",
|
||||
"nipplejs": "^0.10.2",
|
||||
"node-fetch": "^3.3.2",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user