Skip to content

Enable eslint for commonjs #33575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const vitestPlugin = require("@vitest/eslint-plugin");
const vitestPlugin = require('@vitest/eslint-plugin');
const restrictedSyntax = ['WithStatement', 'ForInStatement', 'LabeledStatement', 'SequenceExpression'];

module.exports = {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -161,7 +168,7 @@ module.exports = {
{
files: ['tests/e2e/**'],
plugins: [
'eslint-plugin-playwright'
'eslint-plugin-playwright',
],
extends: [
'plugin:playwright/recommended',
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Loading