@camaro/eslint-config 3.1.0 → 3.2.0
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.
- package/lib/index.d.ts +4 -0
- package/lib/index.js +37 -0
- package/package.json +2 -2
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
import stylistic from "@stylistic/eslint-plugin";
|
2
|
+
import eslintJS from "@eslint/js";
|
3
|
+
import eslintTS from "typescript-eslint";
|
4
|
+
const styleLint = stylistic.configs.customize({
|
5
|
+
indent: 4,
|
6
|
+
jsx: false,
|
7
|
+
quotes: "double",
|
8
|
+
semi: true,
|
9
|
+
});
|
10
|
+
export const common = [
|
11
|
+
eslintJS.configs.recommended,
|
12
|
+
styleLint,
|
13
|
+
{
|
14
|
+
rules: {
|
15
|
+
"prefer-const": ["error", { destructuring: "all" }],
|
16
|
+
"@stylistic/max-len": ["error", { code: 120 }],
|
17
|
+
"@stylistic/array-bracket-newline": "error",
|
18
|
+
},
|
19
|
+
},
|
20
|
+
];
|
21
|
+
const eslintTsRules = [
|
22
|
+
...eslintTS.configs.recommendedTypeChecked,
|
23
|
+
...eslintTS.configs.strictTypeChecked,
|
24
|
+
...eslintTS.configs.stylisticTypeChecked,
|
25
|
+
].reduce((acc, config) => ({ ...acc, ...config.rules }), {});
|
26
|
+
export const ts = [
|
27
|
+
...common,
|
28
|
+
{
|
29
|
+
files: ["**/*.ts"],
|
30
|
+
languageOptions: {
|
31
|
+
parser: eslintTS.parser,
|
32
|
+
parserOptions: { projectService: true },
|
33
|
+
},
|
34
|
+
plugins: { "@typescript-eslint": eslintTS.plugin },
|
35
|
+
rules: { ...eslintTsRules },
|
36
|
+
},
|
37
|
+
];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@camaro/eslint-config",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.2.0",
|
4
4
|
"description": "A shareable eslint config.",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"scripts": {
|
@@ -32,7 +32,7 @@
|
|
32
32
|
"@stylistic/eslint-plugin": "^4.2.0"
|
33
33
|
},
|
34
34
|
"devDependencies": {
|
35
|
-
"@camaro/eslint-config": "^
|
35
|
+
"@camaro/eslint-config": "^3.1.1",
|
36
36
|
"@camaro/tsconfig": "^1.1.1",
|
37
37
|
"@commitlint/cli": "^19.8.0",
|
38
38
|
"@commitlint/config-conventional": "^19.8.0",
|