@cabify/eslint-config 3.0.1-beta-28 → 3.0.1-beta-29

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,166 @@
1
+ import s from "path";
2
+ import e from "typescript-eslint";
3
+ const o = {
4
+ name: "ts-cabify-eslint-config",
5
+ files: ["**/*.ts", "**/*.tsx"],
6
+ rules: {
7
+ "@typescript-eslint/restrict-template-expressions": [
8
+ "error",
9
+ { allowAny: !0 }
10
+ ],
11
+ "@typescript-eslint/array-type": ["error", { default: "array" }],
12
+ "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
13
+ "@typescript-eslint/member-ordering": "error",
14
+ "@typescript-eslint/explicit-function-return-type": "off",
15
+ "@typescript-eslint/naming-convention": [
16
+ "error",
17
+ {
18
+ selector: "default",
19
+ format: ["camelCase"]
20
+ },
21
+ {
22
+ selector: "import",
23
+ format: ["camelCase", "PascalCase", "UPPER_CASE"]
24
+ },
25
+ {
26
+ // This is the 'property' group values. For some reason `property` selector is not recogniced.
27
+ selector: ["classProperty", "objectLiteralProperty", "typeProperty"],
28
+ format: null
29
+ },
30
+ {
31
+ selector: "variableLike",
32
+ format: ["camelCase", "PascalCase"]
33
+ },
34
+ {
35
+ selector: "variable",
36
+ format: ["camelCase", "PascalCase", "UPPER_CASE"]
37
+ },
38
+ {
39
+ // 'memberLike' group selector values without 'property' and 'enumMember'.
40
+ // Don't know why 'memberLike' selector it's not being overriden by 'property' and 'enumMember'
41
+ selector: ["parameterProperty", "method", "accessor"],
42
+ format: ["camelCase", "PascalCase"],
43
+ leadingUnderscore: "allow"
44
+ },
45
+ {
46
+ selector: "memberLike",
47
+ modifiers: ["private"],
48
+ format: ["camelCase"],
49
+ leadingUnderscore: "forbid"
50
+ },
51
+ {
52
+ selector: "typeLike",
53
+ format: ["PascalCase"]
54
+ },
55
+ // Allow leading underscore for untyped parameters on Ts
56
+ // Also allow paramters to be PascalCase to receive React.Components as props.
57
+ {
58
+ selector: "parameter",
59
+ format: ["camelCase", "PascalCase"],
60
+ leadingUnderscore: "allow"
61
+ },
62
+ // Enforce the names of generic types are at least 2 characters long
63
+ {
64
+ selector: "typeParameter",
65
+ format: ["PascalCase"],
66
+ custom: {
67
+ regex: "^[A-Z][a-zA-Z]+$",
68
+ match: !0
69
+ }
70
+ },
71
+ // Enforce that interface names do not begin with an I
72
+ {
73
+ selector: "interface",
74
+ format: ["PascalCase"],
75
+ custom: {
76
+ regex: "^I[A-Z]",
77
+ match: !1
78
+ }
79
+ },
80
+ // Emulate the old @typescript-eslint/class-name-casing
81
+ {
82
+ selector: "class",
83
+ format: ["PascalCase"],
84
+ leadingUnderscore: "forbid"
85
+ },
86
+ {
87
+ selector: "enumMember",
88
+ format: ["UPPER_CASE", "PascalCase"]
89
+ }
90
+ ],
91
+ "@typescript-eslint/no-non-null-assertion": "off",
92
+ "@typescript-eslint/no-explicit-any": "error",
93
+ "@typescript-eslint/no-unused-expressions": [
94
+ "error",
95
+ {
96
+ allowShortCircuit: !0,
97
+ allowTernary: !0,
98
+ allowTaggedTemplates: !1
99
+ }
100
+ ],
101
+ "@typescript-eslint/no-unused-vars": [
102
+ "error",
103
+ { ignoreRestSiblings: !0, argsIgnorePattern: "^_" }
104
+ ],
105
+ "@typescript-eslint/no-use-before-define": [
106
+ "error",
107
+ { functions: !0, classes: !0, variables: !0 }
108
+ ],
109
+ "@typescript-eslint/no-redeclare": ["error"],
110
+ "@typescript-eslint/no-shadow": ["error"],
111
+ "@typescript-eslint/explicit-module-boundary-types": "off",
112
+ // Disabled after upgraded parser
113
+ "@typescript-eslint/no-unsafe-member-access": "off",
114
+ // Disabled after upgraded parser
115
+ "@typescript-eslint/no-unsafe-assignment": "off",
116
+ // Disabled after upgraded parser
117
+ "@typescript-eslint/no-unsafe-call": "off",
118
+ // Disabled after upgraded parser
119
+ "@typescript-eslint/no-unsafe-return": "off",
120
+ // Disabled after upgraded parser
121
+ camelcase: "off",
122
+ // superseeded by @typescript-eslint/naming-conventions
123
+ "import/no-cycle": "off",
124
+ "import/no-default-export": "error",
125
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
126
+ "import/named": "off",
127
+ "import/namespace": "off",
128
+ "import/default": "off",
129
+ "import/no-named-as-default-member": "off",
130
+ "react/sort-comp": "off",
131
+ "react/prop-types": "off",
132
+ // guaranteed by TS prop interfaces
133
+ "react/require-default-props": "off",
134
+ "react/default-props-match-prop-types": "off",
135
+ "no-unused-expressions": "off",
136
+ // superseeded by @typescript-eslint/no-unused-expressions
137
+ "no-unused-vars": "off",
138
+ // superseeded by @typescript-eslint/no-unused-vars
139
+ "import/prefer-default-export": "off",
140
+ "no-useless-constructor": "off",
141
+ "@typescript-eslint/no-useless-constructor": "error",
142
+ "no-use-before-define": "off",
143
+ // superseeded by @typescript-eslint/no-use-before-define
144
+ "no-redeclare": "off",
145
+ // superseeded by @typescript-eslint/no-redeclare
146
+ "no-shadow": "off"
147
+ // superseeded by @typescript-eslint/no-shadow
148
+ },
149
+ languageOptions: {
150
+ parserOptions: {
151
+ projectService: !0,
152
+ tsconfigRootDir: s.resolve(process.cwd())
153
+ }
154
+ },
155
+ ignores: ["*.d.ts"]
156
+ }, t = e.config(
157
+ e.configs.recommended,
158
+ e.configs.recommendedTypeChecked,
159
+ o
160
+ );
161
+ t.length && t.forEach((r) => {
162
+ r.files = ["**/*.ts", "**/*.tsx"], r.ignores = ["**/*.d.ts"];
163
+ });
164
+ export {
165
+ t as tsLintConfig
166
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabify/eslint-config",
3
- "version": "3.0.1-beta-28",
3
+ "version": "3.0.1-beta-29",
4
4
  "description": "ESLint config for Cabify Javascript projects",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -34,10 +34,13 @@
34
34
  "style",
35
35
  "standards"
36
36
  ],
37
- "main": "../recommended.js",
37
+ "main": "./dist/eslint.config.cjs",
38
+ "module": "./dist/eslint.config.js",
38
39
  "exports": {
39
- "require": "./dist/eslint.config.cjs",
40
- "import": "./eslint.config.js"
40
+ ".": {
41
+ "require": "./dist/eslint.config.cjs",
42
+ "import": "./eslint.config.js"
43
+ }
41
44
  },
42
45
  "dependencies": {
43
46
  "@typescript-eslint/eslint-plugin": "^8.15.0",
File without changes