forked from webstudio-is/webstudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
53 lines (51 loc) · 1.48 KB
/
eslint.config.mjs
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
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import reactHooks from "eslint-plugin-react-hooks";
import unicorn from "eslint-plugin-unicorn";
export default tseslint.config({
files: ["**/*.{ts,tsx}"],
ignores: [
"**/*.d.ts",
"**/__generated__/**",
"codemod/**",
"packages/*/lib/**",
"packages/prisma-client/prisma/migrations/**",
"packages/cli/templates/**",
"fixtures/**",
],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
"react-hooks": /** @type {any} */ (reactHooks),
unicorn,
},
},
],
// @ts-ignore
rules: {
...reactHooks.configs.recommended.rules,
"no-console": ["error", { allow: ["info", "warn", "error"] }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-expressions": "off",
"func-style": ["error", "expression", { allowArrowFunctions: true }],
curly: "error",
eqeqeq: ["error", "always", { null: "ignore" }],
camelcase: ["error", { properties: "never" }],
radix: "error",
"unicorn/filename-case": ["error", { case: "kebabCase" }],
"unicorn/prefer-node-protocol": "error",
"no-restricted-syntax": [
"error",
{
message:
"Do not import default from React, use a named imports instead",
selector:
'ImportDeclaration[source.value="react"] ImportDefaultSpecifier',
},
],
},
});