Skip to content

Commit cd577af

Browse files
committed
Clean up eslint config for v10 upgrade
- Remove unused globals (__BASE_PATH__, __PATH_PREFIX__, graphql) — not referenced anywhere in codebase - Remove globals package and languageOptions.globals — only TS files are linted, and TypeScript handles undefined variable checking - Remove all formatting rules (comma-dangle, quotes, semi, max-len, etc.) — Prettier handles formatting - Remove content/** max-len override — base max-len rule was removed, making this a no-op - Remove eslint-config-prettier — nothing left for it to disable after formatting rules removed - Remove eslint-plugin-security — plugin was registered but zero rules were enabled, effectively a no-op - Remove duplicate parser declarations — tseslint.configs.recommended already sets the parser - Remove duplicate await-thenable rule — already included in tseslint.configs.recommended - Remove settings.polyfills — config for eslint-plugin-compat which is not a dependency - Remove settings['import/parsers'] (2 instances) — config for eslint-plugin-import which is not a dependency - Remove parserOptions.requireConfigFile — babel-eslint option, not used by typescript-eslint parser - Remove parserOptions.ecmaFeatures.modules — legacy option, redundant with sourceType: 'module' - Remove ecmaVersion and sourceType — ESLint 10 defaults to 'latest' and 'module' - Remove sourceType: 'script' on .ts file block — was incorrect for TypeScript modules - Remove **/node_modules from ignores — ESLint ignores node_modules by default - Remove .scss import sort group — no .scss imports exist in codebase - Remove dead eslint-disable-next-line max-len comments — rule no longer exists
1 parent dad3309 commit cd577af

4 files changed

Lines changed: 3 additions & 194 deletions

File tree

bin/_headers.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const config: HeadersConfig = {
2222
'https://status.maxmind.com',
2323
'https://www.maxmind.com',
2424

25-
// eslint-disable-next-line max-len
2625
// https://knowledge.hubspot.com/domains-and-urls/ssl-and-domain-security-in-hubspot#content-security-policy
2726

2827
// HubSpot API
@@ -33,7 +32,6 @@ const config: HeadersConfig = {
3332

3433
'https://*.googleapis.com',
3534

36-
// eslint-disable-next-line max-len
3735
// https://developers.google.com/tag-platform/security/guides/csp#google_analytics_4_google_analytics
3836
'https://*.google-analytics.com',
3937
'https://*.analytics.google.com',
@@ -57,7 +55,6 @@ const config: HeadersConfig = {
5755
'frame-src': [
5856
"'self'",
5957

60-
// eslint-disable-next-line max-len
6158
// https://knowledge.hubspot.com/domains-and-urls/ssl-and-domain-security-in-hubspot#content-security-policy
6259

6360
// HubSpot calls-to-action (pop-ups) and chatflows
@@ -76,7 +73,6 @@ const config: HeadersConfig = {
7673
"'report-sample'",
7774
"'unsafe-inline'",
7875

79-
// eslint-disable-next-line max-len
8076
// https://knowledge.hubspot.com/domains-and-urls/ssl-and-domain-security-in-hubspot#content-security-policy
8177

8278
// HubSpot tracking code

eslint.config.mjs

Lines changed: 3 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,25 @@
11
import js from '@eslint/js';
2-
import prettier from 'eslint-config-prettier';
3-
import security from 'eslint-plugin-security';
42
import simpleImportSort from 'eslint-plugin-simple-import-sort';
5-
import globals from 'globals';
63
import tseslint from 'typescript-eslint';
74

85
export default tseslint.config(
96
js.configs.recommended,
107
...tseslint.configs.recommended,
11-
prettier,
128
{
139
ignores: [
1410
'**/*.md',
1511
'**/.cache',
16-
'**/node_modules',
1712
'**/public',
1813
'eslint.config.mjs',
1914
'bin/format-rawhtml.ts'
2015
],
2116
},
2217
{
2318
plugins: {
24-
security,
2519
'simple-import-sort': simpleImportSort,
2620
},
2721

28-
languageOptions: {
29-
globals: {
30-
...globals.browser,
31-
...globals.node,
32-
__BASE_PATH__: true,
33-
__PATH_PREFIX__: true,
34-
graphql: true,
35-
},
36-
37-
parser: tseslint.parser,
38-
ecmaVersion: 6,
39-
sourceType: 'module',
40-
41-
parserOptions: {
42-
ecmaFeatures: {
43-
modules: true,
44-
},
45-
46-
requireConfigFile: false,
47-
},
48-
},
49-
50-
settings: {
51-
'import/parsers': {
52-
'@typescript-eslint/parser': [
53-
'.ts',
54-
],
55-
},
56-
57-
polyfills: [
58-
'CustomEvent',
59-
'fetch',
60-
'IntersectionObserver',
61-
'Promise.all',
62-
'Promise.race',
63-
'Promise.resolve',
64-
'URLSearchParams',
65-
],
66-
},
67-
6822
rules: {
69-
'comma-dangle': [
70-
'warn',
71-
'always-multiline',
72-
],
73-
'eol-last': [
74-
'warn',
75-
'always',
76-
],
77-
78-
'max-len': [
79-
'warn',
80-
{
81-
code: 100,
82-
},
83-
],
84-
85-
'no-trailing-spaces': 'warn',
86-
87-
'object-curly-newline': [
88-
'warn',
89-
{
90-
ExportDeclaration: 'never',
91-
92-
ImportDeclaration: {
93-
multiline: true,
94-
},
95-
96-
ObjectExpression: {
97-
minProperties: 1,
98-
multiline: true,
99-
},
100-
101-
ObjectPattern: {
102-
multiline: true,
103-
},
104-
},
105-
],
106-
107-
'object-curly-spacing': [
108-
'warn',
109-
'always',
110-
{
111-
objectsInObjects: false,
112-
},
113-
],
114-
115-
'object-property-newline': 'warn',
116-
'quote-props': [
117-
'warn',
118-
'as-needed',
119-
],
120-
quotes: [
121-
'warn',
122-
'single',
123-
{
124-
avoidEscape: true,
125-
},
126-
],
127-
semi: [
128-
1,
129-
'always',
130-
],
131-
13223
'simple-import-sort/imports': [
13324
'warn',
13425
{
@@ -145,56 +36,27 @@ export default tseslint.config(
14536
[
14637
'^\\.',
14738
],
148-
[
149-
'\\.scss$',
150-
],
15139
],
15240
},
15341
],
15442
'@typescript-eslint/no-unused-expressions': ['error', {
155-
allowTernary: true
156-
}],
43+
allowTernary: true,
44+
}],
15745
},
158-
},
159-
{
160-
files: [
161-
'content/**',
162-
],
163-
164-
rules: {
165-
'max-len': [
166-
0,
167-
],
168-
},
169-
},
170-
{
46+
}, {
17147
files: [
17248
'**/*.ts',
17349
],
17450

17551
languageOptions: {
176-
parser: tseslint.parser,
177-
ecmaVersion: 5,
178-
sourceType: 'script',
179-
18052
parserOptions: {
18153
project: [
18254
'tsconfig.json',
18355
],
18456
},
18557
},
18658

187-
settings: {
188-
'import/parsers': {
189-
'@typescript-eslint/parser': [
190-
'.ts',
191-
],
192-
},
193-
},
194-
19559
rules: {
196-
'@typescript-eslint/await-thenable': 'error',
197-
19860
'@typescript-eslint/naming-convention': ['error',
19961
{
20062
selector: 'default', format: ['camelCase'],

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
"baseline-browser-mapping": "^2.10.0",
1212
"cspell": "^9.7.0",
1313
"eslint": "^10.0.3",
14-
"eslint-config-prettier": "^10.1.8",
15-
"eslint-plugin-security": "^4.0.0",
1614
"eslint-plugin-simple-import-sort": "^12.1.1",
17-
"globals": "^17.4.0",
1815
"npm-run-all": "^4.1.5",
1916
"prettier": "^3.8.1",
2017
"prettier-plugin-go-template": "^0.0.15",

pnpm-lock.yaml

Lines changed: 0 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)