-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy patheslint.config.mjs
More file actions
146 lines (138 loc) · 3.57 KB
/
eslint.config.mjs
File metadata and controls
146 lines (138 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import headers from "eslint-plugin-headers";
import importX from "eslint-plugin-import-x";
import jest from "eslint-plugin-jest";
import markdownlint from "eslint-plugin-markdownlint";
import markdownlintParser from "eslint-plugin-markdownlint/parser.js";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
// Global ignores (replaces .eslintignore)
{
ignores: [
"**/dist/",
"**/build/",
"**/cmake-build-*/",
"**/coverage/",
"**/node_modules/",
"**/.idea/",
],
},
// Base config for all JS/TS files
js.configs.recommended,
...tseslint.configs.recommended,
eslintConfigPrettier,
importX.flatConfigs.recommended,
importX.flatConfigs.typescript,
// Global settings for JS/TS files
{
languageOptions: {
globals: {
...globals.node,
},
},
settings: {
"import-x/resolver": {
typescript: true,
node: true,
},
},
rules: {
"import-x/no-named-as-default": "off",
"import-x/no-named-as-default-member": "off",
},
},
// JS/TS specific rules (replaces the *.js, *.ts override)
{
files: ["**/*.js", "**/*.ts"],
plugins: {
headers,
},
rules: {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unused-vars": "off",
"headers/header-format": [
"error",
{
source: "string",
blockPrefix: "\n",
content:
'Copyright 2026 Code Intelligence GmbH\n\nLicensed under the Apache License, Version 2.0 (the "License");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.',
},
],
"import-x/first": "error",
"import-x/newline-after-import": "error",
"import-x/no-unresolved": "warn",
"import-x/order": [
"error",
{
alphabetize: { order: "asc", caseInsensitive: true },
"newlines-between": "always",
distinctGroup: true,
pathGroupsExcludedImportTypes: ["builtin"],
pathGroups: [
{
pattern: "@jazzer.js/**",
group: "external",
position: "after",
},
],
},
],
"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true,
},
],
},
},
// Exclude header check from the header template file itself
{
files: [".header.js"],
rules: {
"headers/header-format": "off",
},
},
// Disable unresolved import warnings for examples/tests with their own deps
{
files: ["examples/**", "tests/**"],
rules: {
"import-x/no-unresolved": "off",
},
},
// Jest globals for test and fuzz files
{
files: ["**/*.test.ts", "**/*.test.js", "**/*.fuzz.ts", "**/*.fuzz.js"],
plugins: {
jest,
},
languageOptions: {
globals: {
...globals.jest,
},
},
},
// Markdown files
{
files: ["**/*.md"],
ignores: ["AGENTS.md"],
plugins: {
markdownlint,
},
languageOptions: {
parser: markdownlintParser,
},
rules: {
...markdownlint.configs.recommended.rules,
"markdownlint/md010": "off",
"markdownlint/md013": "off",
"markdownlint/md033": "off",
"markdownlint/md041": "off",
},
},
);