@leexi/shared 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,123 @@
1
+ import js from "@eslint/js";
2
+ import stylisticJS from "@stylistic/eslint-plugin-js";
3
+ import stylisticTS from "@stylistic/eslint-plugin-ts";
4
+ import globals from "globals";
5
+ import tseslint from "typescript-eslint";
6
+ export default [
7
+ js.configs.recommended,
8
+ ...tseslint.configs.recommended,
9
+ // base config
10
+ {
11
+ languageOptions: {
12
+ globals: {
13
+ ...globals.browser,
14
+ ...globals.node
15
+ },
16
+ parserOptions: {
17
+ ecmaVersion: "latest",
18
+ sourceType: "module"
19
+ }
20
+ },
21
+ plugins: {
22
+ "@stylistic/js": stylisticJS
23
+ },
24
+ rules: {
25
+ "arrow-body-style": ["error", "as-needed"],
26
+ "eqeqeq": ["error", "smart"],
27
+ "no-console": "error",
28
+ "no-nested-ternary": "error",
29
+ "no-unused-vars": ["error", {
30
+ argsIgnorePattern: "^_",
31
+ destructuredArrayIgnorePattern: "^_",
32
+ ignoreRestSiblings: true
33
+ }],
34
+ "prefer-const": ["error", {
35
+ destructuring: "all"
36
+ }],
37
+ "prefer-template": "error",
38
+ "@stylistic/js/array-bracket-spacing": ["error", "never"],
39
+ "@stylistic/js/arrow-parens": ["error", "as-needed"],
40
+ "@stylistic/js/comma-dangle": ["error", "always-multiline"],
41
+ "@stylistic/js/comma-spacing": "error",
42
+ "@stylistic/js/eol-last": ["error", "always"],
43
+ "@stylistic/js/indent": ["error", 2, {
44
+ SwitchCase: 1
45
+ }],
46
+ "@stylistic/js/key-spacing": "error",
47
+ "@stylistic/js/keyword-spacing": "error",
48
+ "@stylistic/js/multiline-ternary": ["error", "never"],
49
+ "@stylistic/js/no-multi-spaces": "error",
50
+ "@stylistic/js/no-multiple-empty-lines": ["error", {
51
+ max: 1
52
+ }],
53
+ "@stylistic/js/no-trailing-spaces": "error",
54
+ "@stylistic/js/object-curly-spacing": ["error", "always"],
55
+ "@stylistic/js/quote-props": ["error", "consistent-as-needed"],
56
+ "@stylistic/js/quotes": ["error", "single"],
57
+ "@stylistic/js/semi": ["error", "always"],
58
+ "@stylistic/js/semi-spacing": "error",
59
+ "@stylistic/js/space-before-blocks": ["error", "always"],
60
+ "@stylistic/js/space-before-function-paren": ["error", "always"],
61
+ "@stylistic/js/space-in-parens": ["error", "never"],
62
+ "@stylistic/js/space-infix-ops": "error",
63
+ "@stylistic/js/spaced-comment": "error",
64
+ "@stylistic/js/template-curly-spacing": ["error", "never"],
65
+ "@typescript-eslint/no-unused-expressions": "off",
66
+ "@typescript-eslint/no-unused-vars": ["error", {
67
+ argsIgnorePattern: "^_",
68
+ destructuredArrayIgnorePattern: "^_",
69
+ ignoreRestSiblings: true
70
+ }]
71
+ }
72
+ },
73
+ // typescript
74
+ {
75
+ files: ["**/*.ts", "**/*.vue"],
76
+ plugins: {
77
+ "@stylistic/ts": stylisticTS
78
+ },
79
+ rules: {
80
+ "@stylistic/js/comma-dangle": "off",
81
+ "@stylistic/js/comma-spacing": "off",
82
+ "@stylistic/js/indent": "off",
83
+ "@stylistic/js/key-spacing": "off",
84
+ "@stylistic/js/keyword-spacing": "off",
85
+ "@stylistic/js/object-curly-spacing": "off",
86
+ "@stylistic/js/quote-props": "off",
87
+ "@stylistic/js/quotes": "off",
88
+ "@stylistic/js/semi": "off",
89
+ "@stylistic/js/space-before-blocks": "off",
90
+ "@stylistic/js/space-before-function-paren": "off",
91
+ "@stylistic/js/space-infix-ops": "off",
92
+ "@stylistic/ts/comma-dangle": ["error", "always-multiline"],
93
+ "@stylistic/ts/comma-spacing": "error",
94
+ "@stylistic/ts/indent": ["error", 2, {
95
+ SwitchCase: 1
96
+ }],
97
+ "@stylistic/ts/key-spacing": "error",
98
+ "@stylistic/ts/keyword-spacing": "error",
99
+ "@stylistic/ts/object-curly-spacing": ["error", "always"],
100
+ "@stylistic/ts/quote-props": ["error", "consistent-as-needed"],
101
+ "@stylistic/ts/quotes": ["error", "single"],
102
+ "@stylistic/ts/semi": ["error", "always"],
103
+ "@stylistic/ts/space-before-blocks": ["error", "always"],
104
+ "@stylistic/ts/space-before-function-paren": ["error", "always"],
105
+ "@stylistic/ts/space-infix-ops": "error"
106
+ }
107
+ },
108
+ // sort-keys
109
+ {
110
+ files: ["**/*.config.{js,ts}", "**/locales/**/*.js"],
111
+ rules: {
112
+ "sort-keys": ["error", "asc", {
113
+ allowLineSeparatedGroups: true,
114
+ natural: true
115
+ }]
116
+ }
117
+ },
118
+ {
119
+ ignores: [
120
+ "node_modules/"
121
+ ]
122
+ }
123
+ ];