Skip to content

Commit ce2ae61

Browse files
committed
Enable eslint hook
1 parent 6ca43cf commit ce2ae61

6 files changed

Lines changed: 1528 additions & 600 deletions

File tree

.circleci/config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ version: 2.1
22
jobs:
33
lint:
44
docker:
5-
- image: cimg/python:3.11
5+
- image: cimg/python:3.11-node
66
steps:
77
- checkout
8+
- run:
9+
name: Install Node.js dependencies
10+
command: npm ci
811
- run:
912
name: Lint with pre-commit
1013
command: |
11-
pip install --upgrade pre-commit==3.6.0
14+
pip install pre-commit==4.2.0
1215
pre-commit run --all-files
1316
test-and-build:
1417
docker:

.pre-commit-config.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ repos:
3737
- types-PyYAML==6.0.12.20250402
3838
files: "^kitsune/"
3939
exclude: "/migrations/"
40-
41-
# - repo: https://github.com/pre-commit/mirrors-eslint
42-
# rev: v8.1.0
43-
# hooks:
44-
# - id: eslint
45-
# args: [--no-eslintrc, --config=webpack/eslintrc.js]
46-
# exclude: "webpack/.*|webpack\\..*\\.js"
47-
# additional_dependencies:
48-
# - eslint@8.1.0
49-
# - eslint-import-resolver-webpack@0.13.2
50-
# - eslint-plugin-import@2.25.2
40+
- repo: https://github.com/pre-commit/mirrors-eslint
41+
rev: v9.31.0
42+
hooks:
43+
- id: eslint
44+
files: "^(svelte/|webpack/).*\\.(js|ts|jsx|tsx)$"
45+
exclude: "webpack/.*|webpack\\..*\\.js"
46+
additional_dependencies:
47+
- eslint@9.31.0
48+
- eslint-plugin-import@2.29.1
49+
- eslint-import-resolver-webpack@0.13.10

eslint.config.mjs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import importPlugin from "eslint-plugin-import";
2+
3+
export default [
4+
{
5+
files: ["webpack/**/*.{js,ts,jsx,tsx}", "svelte/**/*.{js,ts,jsx,tsx}"],
6+
ignores: ["**/tests/**"],
7+
plugins: {
8+
import: importPlugin,
9+
},
10+
languageOptions: {
11+
ecmaVersion: "latest",
12+
sourceType: "module",
13+
globals: {
14+
// Browser globals
15+
document: "readonly",
16+
window: "readonly",
17+
// Node.js globals
18+
process: "readonly",
19+
global: "readonly",
20+
// Project-specific globals
21+
Mzp: "readonly",
22+
$: "readonly",
23+
jQuery: "readonly",
24+
gettext: "readonly",
25+
interpolate: "readonly",
26+
Mozilla: "readonly",
27+
_gaq: "readonly",
28+
RICKSHAW_NO_COMPAT: "readonly",
29+
d: "readonly",
30+
},
31+
},
32+
settings: {
33+
"import/resolver": {
34+
webpack: {
35+
config: "./webpack.common.js",
36+
},
37+
},
38+
},
39+
rules: {
40+
"no-undef": 2,
41+
"import/extensions": 2,
42+
"import/first": 2,
43+
"import/no-self-import": 2,
44+
"import/no-cycle": 2,
45+
},
46+
},
47+
];

0 commit comments

Comments
 (0)