@mimica/eslint-config-typescript 4.7.0 → 5.0.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.
Files changed (3) hide show
  1. package/index.mjs +104 -0
  2. package/package.json +1 -1
  3. package/index.js +0 -78
package/index.mjs ADDED
@@ -0,0 +1,104 @@
1
+ import { fixupConfigRules } from "@eslint/compat";
2
+ import stylisticTs from "@stylistic/eslint-plugin-ts";
3
+ import tsParser from "@typescript-eslint/parser";
4
+ import path from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import js from "@eslint/js";
7
+ import { FlatCompat } from "@eslint/eslintrc";
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+ const compat = new FlatCompat({
12
+ baseDirectory: __dirname,
13
+ recommendedConfig: js.configs.recommended,
14
+ allConfig: js.configs.all,
15
+ });
16
+
17
+ export default [
18
+ ...fixupConfigRules(
19
+ compat.extends(
20
+ "@mimica/eslint-config",
21
+ "plugin:@typescript-eslint/strict-type-checked",
22
+ "plugin:@typescript-eslint/stylistic-type-checked",
23
+ "plugin:import/typescript",
24
+ ),
25
+ ),
26
+ {
27
+ plugins: {
28
+ "@stylistic/ts": stylisticTs,
29
+ },
30
+
31
+ languageOptions: {
32
+ parser: tsParser,
33
+ },
34
+
35
+ rules: {
36
+ "default-param-last": 0, // TODO: typescript one already enabled
37
+ "no-shadow": 0, // The TS one is enabled
38
+ "no-unused-vars": 0, // The TS one is enabled
39
+ "no-use-before-define": 0, // The TS one is enabled
40
+
41
+ "@stylistic/ts/padding-line-between-statements": [
42
+ 2,
43
+ {
44
+ blankLine: "always",
45
+ prev: "*",
46
+ next: ["function", "class", "cjs-export", "interface", "type"],
47
+ },
48
+ {
49
+ blankLine: "always",
50
+ prev: ["function", "class", "cjs-export", "interface", "type"],
51
+ next: "*",
52
+ },
53
+ ],
54
+
55
+ "@typescript-eslint/default-param-last": 2,
56
+ "@typescript-eslint/explicit-module-boundary-types": 0,
57
+ "@typescript-eslint/consistent-type-imports": [
58
+ 2,
59
+ {
60
+ fixStyle: "inline-type-imports",
61
+ },
62
+ ],
63
+ // "@typescript-eslint/member-delimiter-style": [
64
+ // 2,
65
+ // {
66
+ // multiline: {
67
+ // delimiter: "comma",
68
+ // requireLast: true,
69
+ // },
70
+ // singleline: {
71
+ // delimiter: "comma",
72
+ // requireLast: false,
73
+ // },
74
+ // },
75
+ // ],
76
+ "@typescript-eslint/method-signature-style": 2,
77
+ "@typescript-eslint/no-floating-promises": 0, // TODO: enable this and fix errors
78
+ "@typescript-eslint/no-misused-promises": 0,
79
+ "@typescript-eslint/no-shadow": 2,
80
+ "@typescript-eslint/no-unnecessary-condition": 0, // TODO: enable this and fix errors
81
+ "@typescript-eslint/no-unnecessary-type-parameters": 0,
82
+ "@typescript-eslint/no-unsafe-argument": 0,
83
+ "@typescript-eslint/no-unsafe-assignment": 0,
84
+ "@typescript-eslint/no-unsafe-call": 0,
85
+ "@typescript-eslint/no-unsafe-member-access": 0,
86
+ "@typescript-eslint/no-unsafe-return": 0,
87
+ "@typescript-eslint/prefer-nullish-coalescing": [
88
+ 2,
89
+ {
90
+ ignoreConditionalTests: true,
91
+ ignorePrimitives: {
92
+ boolean: true,
93
+ bigint: true,
94
+ number: true,
95
+ string: true,
96
+ },
97
+ },
98
+ ],
99
+ "@typescript-eslint/prefer-readonly": 2,
100
+ "@typescript-eslint/restrict-template-expressions": 0,
101
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": 0,
102
+ },
103
+ },
104
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mimica/eslint-config-typescript",
3
- "version": "4.7.0",
3
+ "version": "5.0.0",
4
4
  "description": "Mimica eslint config",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/index.js DELETED
@@ -1,78 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "@mimica/eslint-config",
4
- "plugin:@typescript-eslint/strict-type-checked",
5
- "plugin:@typescript-eslint/stylistic-type-checked",
6
- "plugin:import/typescript",
7
- ],
8
- plugins: ["@stylistic/ts"],
9
- parser: "@typescript-eslint/parser",
10
- rules: {
11
- "default-param-last": 0, // TODO: typescript one already enabled
12
- "no-shadow": 0, // The TS one is enabled
13
- "no-unused-vars": 0, // The TS one is enabled
14
- "no-use-before-define": 0, // The TS one is enabled
15
-
16
- "@stylistic/ts/padding-line-between-statements": [
17
- 2,
18
- {
19
- blankLine: "always",
20
- prev: "*",
21
- next: ["function", "class", "cjs-export", "interface", "type"],
22
- },
23
- {
24
- blankLine: "always",
25
- prev: ["function", "class", "cjs-export", "interface", "type"],
26
- next: "*",
27
- },
28
- ],
29
-
30
- "@typescript-eslint/default-param-last": 2,
31
- "@typescript-eslint/explicit-module-boundary-types": 0,
32
- "@typescript-eslint/consistent-type-imports": [
33
- 2,
34
- {
35
- fixStyle: "inline-type-imports",
36
- },
37
- ],
38
- // "@typescript-eslint/member-delimiter-style": [
39
- // 2,
40
- // {
41
- // multiline: {
42
- // delimiter: "comma",
43
- // requireLast: true,
44
- // },
45
- // singleline: {
46
- // delimiter: "comma",
47
- // requireLast: false,
48
- // },
49
- // },
50
- // ],
51
- "@typescript-eslint/method-signature-style": 2,
52
- "@typescript-eslint/no-floating-promises": 0, // TODO: enable this and fix errors
53
- "@typescript-eslint/no-misused-promises": 0,
54
- "@typescript-eslint/no-shadow": 2,
55
- "@typescript-eslint/no-unnecessary-condition": 0, // TODO: enable this and fix errors
56
- "@typescript-eslint/no-unnecessary-type-parameters": 0,
57
- "@typescript-eslint/no-unsafe-argument": 0,
58
- "@typescript-eslint/no-unsafe-assignment": 0,
59
- "@typescript-eslint/no-unsafe-call": 0,
60
- "@typescript-eslint/no-unsafe-member-access": 0,
61
- "@typescript-eslint/no-unsafe-return": 0,
62
- "@typescript-eslint/prefer-nullish-coalescing": [
63
- 2,
64
- {
65
- ignoreConditionalTests: true,
66
- ignorePrimitives: {
67
- boolean: true,
68
- bigint: true,
69
- number: true,
70
- string: true,
71
- },
72
- },
73
- ],
74
- "@typescript-eslint/prefer-readonly": 2,
75
- "@typescript-eslint/restrict-template-expressions": 0,
76
- "@typescript-eslint/use-unknown-in-catch-callback-variable": 0,
77
- },
78
- };