Skip to content
Open
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: 1 addition & 0 deletions template/.prettierignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
**/package.json
!/package.json
{{python_name}}
eslint.config.mjs
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This .prettierignore entry is currently a no-op: the prettier:base script only targets .ts/.tsx/.js/.jsx/.css/.json/.md, so eslint.config.mjs won’t be formatted anyway. Either remove this ignore line or update the Prettier glob to include .mjs if you want the config file formatted/checked.

Suggested change
eslint.config.mjs

Copilot uses AI. Check for mistakes.
67 changes: 67 additions & 0 deletions template/eslint.config.mjs.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import js from '@eslint/js';
import { defineConfig } from 'eslint/config';
Comment on lines +1 to +2
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description mentions migrating to .eslint.config.mjs, but the template adds eslint.config.mjs (no leading dot). Please align the description and the generated filename so users know what to expect (and so tooling/docs references don’t drift).

Copilot uses AI. Check for mistakes.
import tseslint from 'typescript-eslint';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import jupyterPlugin from '@jupyter/eslint-plugin';

export default defineConfig([
{
ignores: [
'node_modules',
'dist',
'coverage',
'**/*.js',
'**/*.d.ts'{% if test %},
'tests',
'**/__tests__',
'ui-tests'{% endif %}
]
},
js.configs.recommended,
tseslint.configs.recommended,
jupyterPlugin.configs.recommended,
Comment on lines +22 to +23
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typescript-eslint flat-config configs.recommended is an array of config objects; including it as a single array element produces a nested array that ESLint won’t accept. Spread the recommended configs into the top-level config array (same concern for jupyterPlugin.configs.recommended if it is also an array).

Suggested change
tseslint.configs.recommended,
jupyterPlugin.configs.recommended,
...(Array.isArray(tseslint.configs.recommended)
? tseslint.configs.recommended
: [tseslint.configs.recommended]),
...(Array.isArray(jupyterPlugin.configs.recommended)
? jupyterPlugin.configs.recommended
: [jupyterPlugin.configs.recommended]),

Copilot uses AI. Check for mistakes.
{
files: ['**/*.ts', '**/*.tsx'],
plugins: {
jupyter: jupyterPlugin
},
languageOptions: {
globals: {
...globals.browser,
...globals.es2015,
...globals.node
},
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module'
}
},
rules: {
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true
}
}
],
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/quotes': [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: false }
],
curly: ['error', 'all'],
eqeqeq: 'error',
'prefer-arrow-callback': 'error'
}
},
prettierRecommended
]);
77 changes: 8 additions & 69 deletions template/package.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"clean:labextension": "rimraf {{ python_name }}/labextension {{ python_name }}/_version.py",
"clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
"eslint": "jlpm eslint:check --fix",
"eslint:check": "eslint . --cache --ext .ts,.tsx",
"eslint:check": "eslint . --cache",
"install:extension": "jlpm build",
"lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
"lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
Expand Down Expand Up @@ -71,12 +71,14 @@
"@types/json-schema": "^7.0.11",
"@types/react": "^18.0.26",
"@types/react-addons-linked-state-mixin": "^0.14.22",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"@eslint/js": "^9.0.0",
"@jupyter/eslint-plugin": "^0.0.5",
"typescript-eslint": "^8.0.0",
"css-loader": "^6.7.1",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^5.0.0",{% if test %}
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"globals": "^15.0.0",{% if test %}
"jest": "^29.2.0",{% endif %}{% if kind.lower() == 'frontend-and-server' %}
"mkdirp": "^1.0.3",{% endif %}
"npm-run-all2": "^7.0.1",
Expand Down Expand Up @@ -121,69 +123,6 @@
"schemaDir": "schema"{% endif %}{% if kind.lower() == 'theme' %},
"themePath": "style/index.css"{% endif %}
},
"eslintIgnore": [
"node_modules",
"dist",
"coverage",
"**/*.d.ts"{% if test %},
"tests",
"**/__tests__",
"ui-tests"{% endif %}
],
"eslintConfig": {
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "interface",
"format": [
"PascalCase"
],
"custom": {
"regex": "^I[A-Z]",
"match": true
}
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "none"
}
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": false
}
],
"curly": [
"error",
"all"
],
"eqeqeq": "error",
"prefer-arrow-callback": "error"
}
},
"prettier": {
"singleQuote": true,
"trailingComma": "none",
Expand Down
Loading