Skip to content

Commit 4990335

Browse files
authored
Merge pull request #654 from manics/update
Update Eslint
2 parents db2bf29 + c7c7cc1 commit 4990335

File tree

7 files changed

+371
-415
lines changed

7 files changed

+371
-415
lines changed

.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +0,0 @@
1-
module.exports = {
2-
extends: [
3-
'eslint:recommended',
4-
'plugin:@typescript-eslint/eslint-recommended',
5-
'plugin:@typescript-eslint/recommended',
6-
'plugin:prettier/recommended',
7-
],
8-
parser: '@typescript-eslint/parser',
9-
parserOptions: {
10-
project: 'tsconfig.json',
11-
sourceType: 'module',
12-
},
13-
plugins: ['@typescript-eslint'],
14-
rules: {
15-
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
16-
'@typescript-eslint/no-explicit-any': 'off',
17-
'@typescript-eslint/no-namespace': 'off',
18-
'@typescript-eslint/no-use-before-define': 'off',
19-
'@typescript-eslint/quotes': [
20-
'error',
21-
'single',
22-
{ avoidEscape: true, allowTemplateLiterals: false },
23-
],
24-
curly: ['error', 'all'],
25-
eqeqeq: 'error',
26-
'prefer-arrow-callback': 'error',
27-
},
28-
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ dmypy.json
141141
# JavaScript
142142
node_modules
143143
tsconfig.tsbuildinfo
144+
.yarn
144145

145146
# Extension output
146147
jupyter_offlinenotebook/static/jslib/

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ lib
44
node_modules
55
package.json
66
.pytest_cache
7+
.yarn

eslint.config.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import js from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import eslintConfigPrettier from 'eslint-config-prettier';
4+
5+
export default tseslint.config(
6+
// Global ignores
7+
{
8+
ignores: ['dist/', 'coverage/', '**/*.d.ts', 'tests/'],
9+
},
10+
// Base recommended configurations
11+
js.configs.recommended,
12+
...tseslint.configs.recommended,
13+
14+
// Custom configuration for the project
15+
{
16+
files: ['src/**/*.ts', 'src/**/*.tsx'],
17+
languageOptions: {
18+
parserOptions: {
19+
project: true,
20+
tsconfigRootDir: import.meta.dirname,
21+
},
22+
},
23+
rules: {
24+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
25+
'@typescript-eslint/no-explicit-any': 'off',
26+
'@typescript-eslint/no-namespace': 'off',
27+
'@typescript-eslint/no-use-before-define': 'off',
28+
'@typescript-eslint/quotes': [
29+
'error',
30+
'single',
31+
{ avoidEscape: true, allowTemplateLiterals: false },
32+
],
33+
curly: ['error', 'all'],
34+
eqeqeq: 'error',
35+
'prefer-arrow-callback': 'error',
36+
},
37+
},
38+
39+
// Prettier config must be last to override other formatting rules
40+
eslintConfigPrettier,
41+
);

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
"license": "BSD-3-Clause",
1515
"author": "Simon Li",
1616
"files": [
17-
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
18-
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}"
17+
"lib/",
18+
"style/",
19+
"README.md"
1920
],
2021
"main": "lib/index.js",
2122
"types": "lib/index.d.ts",
@@ -24,6 +25,7 @@
2425
"type": "git",
2526
"url": "https://github.com/manics/jupyter-offlinenotebook.git"
2627
},
28+
"type": "module",
2729
"//": "Dependency versions are based on https://github.com/jupyterlab/jupyterlab/blob/v3.6.1/examples/notebook/package.json",
2830
"scripts": {
2931
"build": "jlpm run build:lib",
@@ -35,8 +37,8 @@
3537
"clean:labextension": "rimraf jupyter_offlinenotebook/static/lab",
3638
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
3739
"default": "jlpm run clean && jlpm run build:all",
38-
"eslint": "eslint . --ext .ts,.tsx --fix",
39-
"eslint:check": "eslint . --ext .ts,.tsx",
40+
"eslint": "eslint 'src/**/*.{ts,tsx}' --fix",
41+
"eslint:check": "eslint 'src/**/*.{ts,tsx}'",
4042
"format": "jlpm run eslint && jlpm run prettier",
4143
"format:check": "jlpm run eslint:check && jlpm run prettier:check",
4244
"install:extension": "jupyter labextension develop --overwrite .",
@@ -58,22 +60,21 @@
5860
"@lumino/disposable": "^2.1.4",
5961
"@lumino/widgets": "^2.7.1",
6062
"@types/jquery": "^3",
61-
"dexie": "^4.0.8",
63+
"dexie": "^4.2.0",
6264
"jquery": "^3"
6365
},
6466
"devDependencies": {
67+
"@eslint/js": "^9.36.0",
6568
"@jupyterlab/builder": "^4.4.9",
66-
"@typescript-eslint/eslint-plugin": "^7.18.0",
67-
"@typescript-eslint/parser": "^7.18.0",
68-
"eslint": "^8.56.0",
69-
"eslint-config-prettier": "^9.1.0",
70-
"eslint-plugin-prettier": "^5.2.1",
69+
"eslint": "^9.36.0",
70+
"eslint-config-prettier": "^10.1.8",
7171
"mkdirp": "^3.0.1",
72-
"npm-check-updates": "^17.1.0",
72+
"npm-check-updates": "^19.0.0",
7373
"npm-run-all": "^4.1.5",
74-
"prettier": "^3.3.3",
74+
"prettier": "^3.6.2",
7575
"rimraf": "^6.0.1",
76-
"typescript": "^5.5.4"
76+
"typescript": "^5.9.3",
77+
"typescript-eslint": "^8.45.0"
7778
},
7879
"sideEffects": [
7980
"style/*.css"

0 commit comments

Comments
 (0)