forked from baserow/baserow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
84 lines (82 loc) · 2.53 KB
/
eslint.config.mjs
File metadata and controls
84 lines (82 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// @ts-check
import withNuxt from "./web-frontend/.nuxt/eslint.config.mjs";
import globals from "./web-frontend/node_modules/globals/index.js";
import vitest from "./web-frontend/node_modules/eslint-plugin-vitest/dist/index.mjs";
import eslintConfigPrettier from "./web-frontend/node_modules/eslint-config-prettier/index.js";
// Export factory function for reusability in plugins
export const createBaserowConfig = ({ extraSourceFiles = [] } = {}) => {
return withNuxt([
{
ignores: [
"**/node_modules/**",
"**/.nuxt/**",
"**/coverage/**",
"**/generated/**",
"**/.nuxt-storybook/**",
"**/dist/**",
"**/.output/**",
"**/.storybook/**",
"**/vitest.setup.ts",
],
},
eslintConfigPrettier, // deactivate eslint rules that conflict with prettier
{
files: [
"web-frontend/**/*.{js,ts,mjs,mts,jsx,tsx,vue}",
"premium/web-frontend/**/*.{js,ts,mjs,mts,jsx,tsx,vue}",
"enterprise/web-frontend/**/*.{js,ts,mjs,mts,jsx,tsx,vue}",
...extraSourceFiles,
],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
"no-console": 0,
"vue/no-mutating-props": 0,
"import/order": "off",
"vue/html-self-closing": "off",
"vue/no-unused-components": "warn",
"vue/no-use-computed-property-like-method": "off",
"vue/multi-word-component-names": "off",
"vue/no-reserved-component-names": "off",
"import/no-named-as-default-member": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"no-empty": "off",
},
},
// Plugin specific overrides
{
files: [
"premium/web-frontend/**/*.{js,ts,mjs,mts,jsx,tsx,vue}",
"enterprise/web-frontend/**/*.{js,ts,mjs,mts,jsx,tsx,vue}",
...extraSourceFiles, // Apply these rules to plugins too
],
rules: {
"vue/order-in-components": "off",
},
},
// Test files configuration
{
files: [
"**/*.{test,spec}.{js,ts,jsx,tsx}",
"**/__tests__/**/*.{js,ts,jsx,tsx}",
],
plugins: { vitest },
languageOptions: {
globals: {
...vitest.environments.env.globals,
},
},
rules: {
...vitest.configs.recommended.rules,
},
},
]);
};
export default createBaserowConfig();