diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0b30928314..83410dc07c 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,4 +1,4 @@ -const vitestPlugin = require("@vitest/eslint-plugin"); +const vitestPlugin = require('@vitest/eslint-plugin'); const restrictedSyntax = ['WithStatement', 'ForInStatement', 'LabeledStatement', 'SequenceExpression']; module.exports = { @@ -45,6 +45,13 @@ module.exports = { node: true, }, overrides: [ + { + files: ['**/*.cjs'], + rules: { + 'import-x/no-commonjs': [0], + '@typescript-eslint/no-require-imports': [0], + }, + }, { files: ['web_src/**/*'], globals: { @@ -81,7 +88,7 @@ module.exports = { }, { files: ['**/*.test.*', 'web_src/js/test/setup.ts'], - plugins: ["@vitest/eslint-plugin"], + plugins: ['@vitest/eslint-plugin'], globals: vitestPlugin.environments.env.globals, rules: { '@vitest/consistent-test-filename': [0], @@ -161,7 +168,7 @@ module.exports = { { files: ['tests/e2e/**'], plugins: [ - 'eslint-plugin-playwright' + 'eslint-plugin-playwright', ], extends: [ 'plugin:playwright/recommended', diff --git a/Makefile b/Makefile index 8864a18c1a..d87d3a0946 100644 --- a/Makefile +++ b/Makefile @@ -144,7 +144,7 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMAN GO_DIRS := build cmd models modules routers services tests WEB_DIRS := web_src/js web_src/css -ESLINT_FILES := web_src/js tools *.js *.ts tests/e2e +ESLINT_FILES := web_src/js tools *.js *.ts *.cjs tests/e2e STYLELINT_FILES := web_src/css web_src/js/components/*.vue 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)) EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini diff --git a/tsconfig.json b/tsconfig.json index ebcb77cd7d..25b500c10d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,13 @@ { "include": [ - "*", - "tests/e2e/**/*", - "tools/**/*", - "web_src/js/**/*", + "${configDir}/.*", + "${configDir}/*", + "${configDir}/tests/e2e/**/*", + "${configDir}/tests/e2e/**/.*", + "${configDir}/tools/**/*", + "${configDir}/tools/**/.*", + "${configDir}/web_src/js/**/*", + "${configDir}/web_src/js/**/.*", ], "compilerOptions": { "target": "es2020",