Skip to content

Commit 28ea2f4

Browse files
Merge pull request #2073 from umbraco/dependabot/npm_and_yarn/eslint-9.6.0
Bump eslint from 8.57.0 to 9.6.0
2 parents 60054a8 + f2e5790 commit 28ea2f4

File tree

338 files changed

+3176
-2375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

338 files changed

+3176
-2375
lines changed

.eslintignore

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

.eslintrc.json

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

.github/workflows/build_test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636
uses: actions/setup-node@v4
3737
with:
3838
node-version: ${{ matrix.node-version }}
39-
cache: 'npm'
39+
cache: npm
40+
cache-dependency-path: package-lock.json
4041
- run: npm ci --no-audit --no-fund --prefer-offline
4142
- run: npm run lint:errors
4243
- run: npm run build

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Ignore auto-generated backend-api files
22
src/external/backend-api/src
3+
src/packages/core/icon-registry/icons.ts
4+
src/packages/core/icon-registry/icons

devops/eslint/rules/exported-string-constant-naming.cjs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
1+
/** @type {import('eslint').Rule.RuleModule}*/
12
module.exports = {
23
meta: {
34
type: 'problem',
45
docs: {
56
description:
67
'Ensure all exported string constants should be in uppercase with words separated by underscores and prefixed with UMB_',
78
},
9+
schema: [
10+
{
11+
type: 'object',
12+
properties: {
13+
excludedFileNames: {
14+
type: 'array',
15+
items: {
16+
type: 'string',
17+
},
18+
},
19+
},
20+
additionalProperties: false,
21+
},
22+
],
823
},
924
create: function (context) {
1025
const excludedFileNames = context.options[0]?.excludedFileNames || [];
1126
return {
1227
ExportNamedDeclaration(node) {
13-
const fileName = context.getFilename();
28+
const fileName = context.filename;
1429

1530
if (excludedFileNames.some((excludedFileName) => fileName.includes(excludedFileName))) {
1631
// Skip the rule check for files in the excluded list

eslint.config.js

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import importPlugin from "eslint-plugin-import";
4+
import localRules from "eslint-plugin-local-rules";
5+
import wcPlugin from "eslint-plugin-wc";
6+
import litPlugin from "eslint-plugin-lit";
7+
import litA11yPlugin from "eslint-plugin-lit-a11y";
8+
import storybookPlugin from "eslint-plugin-storybook";
9+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
10+
import tseslint from 'typescript-eslint';
11+
12+
export default [
13+
// Recommended config applied to all files
14+
js.configs.recommended,
15+
...tseslint.configs.recommended,
16+
eslintPluginPrettierRecommended,
17+
18+
// Global ignores
19+
{
20+
ignores: [
21+
"**/rollup.config.js",
22+
"**/vite.config.ts",
23+
"src/external",
24+
"src/packages/core/icon-registry/icons",
25+
"src/packages/core/icon-registry/icons.ts"
26+
],
27+
},
28+
29+
// Global config
30+
{
31+
languageOptions: {
32+
parserOptions: {
33+
project: true,
34+
tsconfigRootDir: import.meta.dirname,
35+
},
36+
globals: {
37+
...globals.browser,
38+
}
39+
},
40+
plugins: {
41+
import: importPlugin,
42+
"local-rules": localRules,
43+
"wc": wcPlugin,
44+
"lit": litPlugin,
45+
"lit-a11y": litA11yPlugin,
46+
"storybook": storybookPlugin
47+
},
48+
rules: {
49+
semi: ["warn", "always"],
50+
"no-unused-vars": "warn",
51+
"no-var": "error",
52+
"import/no-unresolved": "off",
53+
"import/order": ["warn", { "groups": ["builtin", "parent", "sibling", "index", "external"] }],
54+
"import/no-self-import": "error",
55+
"import/no-cycle": ["error", { "maxDepth": 6, "allowUnsafeDynamicCyclicDependency": true }],
56+
"local-rules/bad-type-import": "error",
57+
"local-rules/enforce-element-suffix-on-element-class-name": "error",
58+
"local-rules/enforce-umb-prefix-on-element-name": "error",
59+
"local-rules/ensure-relative-import-use-js-extension": "error",
60+
"local-rules/no-direct-api-import": "warn",
61+
"local-rules/prefer-import-aliases": "error",
62+
"local-rules/prefer-static-styles-last": "warn",
63+
"local-rules/umb-class-prefix": "error",
64+
"local-rules/no-relative-import-to-import-map-module": "error",
65+
"local-rules/enforce-umbraco-external-imports": [
66+
"error",
67+
{
68+
"exceptions": ["@umbraco-cms", "@open-wc/testing", "@storybook", "msw", ".", "vite"]
69+
}
70+
],
71+
"local-rules/exported-string-constant-naming": [
72+
"error",
73+
{
74+
"excludedFileNames": ["umbraco-package", "input-tiny-mce.defaults"] // TODO: what to do about the tiny mce defaults?
75+
}
76+
],
77+
"@typescript-eslint/no-non-null-assertion": "off",
78+
"@typescript-eslint/no-explicit-any": "warn",
79+
"@typescript-eslint/no-unused-vars": "warn",
80+
"@typescript-eslint/consistent-type-exports": "error",
81+
"@typescript-eslint/consistent-type-imports": "error",
82+
"@typescript-eslint/no-import-type-side-effects": "warn"
83+
}
84+
},
85+
86+
// Pattern-specific overrides
87+
{
88+
files: ['**/*.js'],
89+
...tseslint.configs.disableTypeChecked,
90+
languageOptions: {
91+
globals: {
92+
...globals.node,
93+
}
94+
}
95+
},
96+
];

0 commit comments

Comments
 (0)