Skip to content

Commit 3e39583

Browse files
authored
Enable eslint for commonjs (#33575)
1 parent e741448 commit 3e39583

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

.eslintrc.cjs

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const vitestPlugin = require("@vitest/eslint-plugin");
1+
const vitestPlugin = require('@vitest/eslint-plugin');
22
const restrictedSyntax = ['WithStatement', 'ForInStatement', 'LabeledStatement', 'SequenceExpression'];
33

44
module.exports = {
@@ -45,6 +45,13 @@ module.exports = {
4545
node: true,
4646
},
4747
overrides: [
48+
{
49+
files: ['**/*.cjs'],
50+
rules: {
51+
'import-x/no-commonjs': [0],
52+
'@typescript-eslint/no-require-imports': [0],
53+
},
54+
},
4855
{
4956
files: ['web_src/**/*'],
5057
globals: {
@@ -81,7 +88,7 @@ module.exports = {
8188
},
8289
{
8390
files: ['**/*.test.*', 'web_src/js/test/setup.ts'],
84-
plugins: ["@vitest/eslint-plugin"],
91+
plugins: ['@vitest/eslint-plugin'],
8592
globals: vitestPlugin.environments.env.globals,
8693
rules: {
8794
'@vitest/consistent-test-filename': [0],
@@ -161,7 +168,7 @@ module.exports = {
161168
{
162169
files: ['tests/e2e/**'],
163170
plugins: [
164-
'eslint-plugin-playwright'
171+
'eslint-plugin-playwright',
165172
],
166173
extends: [
167174
'plugin:playwright/recommended',

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMAN
144144
GO_DIRS := build cmd models modules routers services tests
145145
WEB_DIRS := web_src/js web_src/css
146146

147-
ESLINT_FILES := web_src/js tools *.js *.ts tests/e2e
147+
ESLINT_FILES := web_src/js tools *.js *.ts *.cjs tests/e2e
148148
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
149149
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.js *.md *.yml *.yaml *.toml))
150150
EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini

tsconfig.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
"include": [
3-
"*",
4-
"tests/e2e/**/*",
5-
"tools/**/*",
6-
"web_src/js/**/*",
3+
"${configDir}/.*",
4+
"${configDir}/*",
5+
"${configDir}/tests/e2e/**/*",
6+
"${configDir}/tests/e2e/**/.*",
7+
"${configDir}/tools/**/*",
8+
"${configDir}/tools/**/.*",
9+
"${configDir}/web_src/js/**/*",
10+
"${configDir}/web_src/js/**/.*",
711
],
812
"compilerOptions": {
913
"target": "es2020",

0 commit comments

Comments
 (0)