Skip to content

Commit f21a253

Browse files
committed
Enable eslint for commonjs
1 parent bcd1317 commit f21a253

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

.eslintrc.cjs

Lines changed: 10 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
"include": [
3+
".*",
34
"*",
45
"tests/e2e/**/*",
6+
"tests/e2e/**/.*",
57
"tools/**/*",
8+
"tools/**/.*",
69
"web_src/js/**/*",
10+
"web_src/js/**/.*",
711
],
812
"compilerOptions": {
913
"target": "es2020",

0 commit comments

Comments
 (0)