@cabify/eslint-config 3.0.1-beta-33 → 3.0.1-beta-34
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/dist/conditionalPackagesLegacy.cjs +3 -3
- package/dist/jest.cjs +1 -0
- package/dist/jest.js +11 -1
- package/dist/ts.cjs +1 -0
- package/dist/ts.js +166 -1
- package/package.json +1 -1
- package/dist/conditionalPackages-CS9m2_zE.mjs +0 -25
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
/* eslint-disable global-require */
|
|
4
4
|
function isPackageAvailable(packageName) {
|
|
5
5
|
try {
|
|
@@ -21,12 +21,12 @@ const getConditionalPackages = () => {
|
|
|
21
21
|
isJestAvailable = isPackageAvailable('jest');
|
|
22
22
|
|
|
23
23
|
if (isTSAvailable) {
|
|
24
|
-
const tsModule = require('./ts.
|
|
24
|
+
const tsModule = require('./ts.cjs');
|
|
25
25
|
tsConfigs = tsModule.tsLintConfig;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
if (isJestAvailable) {
|
|
29
|
-
const jestModule = require('./jest.
|
|
29
|
+
const jestModule = require('./jest.cjs');
|
|
30
30
|
jestConfigs = jestModule.jestConf;
|
|
31
31
|
}
|
|
32
32
|
|
package/dist/jest.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("eslint-plugin-jest"),t={name:"jest-cabify-eslint-config",...e.configs["flat/recommended"],rules:{...e.configs["flat/recommended"].rules}};exports.jestConf=t;
|
package/dist/jest.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import e from "eslint-plugin-jest";
|
|
2
|
+
const n = {
|
|
3
|
+
name: "jest-cabify-eslint-config",
|
|
4
|
+
...e.configs["flat/recommended"],
|
|
5
|
+
rules: {
|
|
6
|
+
...e.configs["flat/recommended"].rules
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
n as jestConf
|
|
11
|
+
};
|
package/dist/ts.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("path"),e=require("typescript-eslint"),o={name:"ts-cabify-eslint-config",files:["**/*.ts","**/*.tsx"],rules:{"@typescript-eslint/restrict-template-expressions":["error",{allowAny:!0}],"@typescript-eslint/array-type":["error",{default:"array"}],"@typescript-eslint/consistent-type-definitions":["error","interface"],"@typescript-eslint/member-ordering":"error","@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/naming-convention":["error",{selector:"default",format:["camelCase"]},{selector:"import",format:["camelCase","PascalCase","UPPER_CASE"]},{selector:["classProperty","objectLiteralProperty","typeProperty"],format:null},{selector:"variableLike",format:["camelCase","PascalCase"]},{selector:"variable",format:["camelCase","PascalCase","UPPER_CASE"]},{selector:["parameterProperty","method","accessor"],format:["camelCase","PascalCase"],leadingUnderscore:"allow"},{selector:"memberLike",modifiers:["private"],format:["camelCase"],leadingUnderscore:"forbid"},{selector:"typeLike",format:["PascalCase"]},{selector:"parameter",format:["camelCase","PascalCase"],leadingUnderscore:"allow"},{selector:"typeParameter",format:["PascalCase"],custom:{regex:"^[A-Z][a-zA-Z]+$",match:!0}},{selector:"interface",format:["PascalCase"],custom:{regex:"^I[A-Z]",match:!1}},{selector:"class",format:["PascalCase"],leadingUnderscore:"forbid"},{selector:"enumMember",format:["UPPER_CASE","PascalCase"]}],"@typescript-eslint/no-non-null-assertion":"off","@typescript-eslint/no-explicit-any":"error","@typescript-eslint/no-unused-expressions":["error",{allowShortCircuit:!0,allowTernary:!0,allowTaggedTemplates:!1}],"@typescript-eslint/no-unused-vars":["error",{ignoreRestSiblings:!0,argsIgnorePattern:"^_"}],"@typescript-eslint/no-use-before-define":["error",{functions:!0,classes:!0,variables:!0}],"@typescript-eslint/no-redeclare":["error"],"@typescript-eslint/no-shadow":["error"],"@typescript-eslint/explicit-module-boundary-types":"off","@typescript-eslint/no-unsafe-member-access":"off","@typescript-eslint/no-unsafe-assignment":"off","@typescript-eslint/no-unsafe-call":"off","@typescript-eslint/no-unsafe-return":"off",camelcase:"off","import/no-cycle":"off","import/no-default-export":"error","import/named":"off","import/namespace":"off","import/default":"off","import/no-named-as-default-member":"off","react/sort-comp":"off","react/prop-types":"off","react/require-default-props":"off","react/default-props-match-prop-types":"off","no-unused-expressions":"off","no-unused-vars":"off","import/prefer-default-export":"off","no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"error","no-use-before-define":"off","no-redeclare":"off","no-shadow":"off"},languageOptions:{parserOptions:{projectService:!0,tsconfigRootDir:s.resolve(process.cwd())}},ignores:["*.d.ts"]},r=e.config(e.configs.recommended,e.configs.recommendedTypeChecked,o);r.length&&r.forEach(t=>{t.files=["**/*.ts","**/*.tsx"],t.ignores=["**/*.d.ts"]});exports.tsLintConfig=r;
|
package/dist/ts.js
CHANGED
|
@@ -1 +1,166 @@
|
|
|
1
|
-
|
|
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,25 +0,0 @@
|
|
|
1
|
-
async function n(t) {
|
|
2
|
-
try {
|
|
3
|
-
return await import(t), !0;
|
|
4
|
-
} catch {
|
|
5
|
-
return !1;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
const l = async () => {
|
|
9
|
-
let t = !1, a = !1, e = [], s = {};
|
|
10
|
-
if (t = await n("typescript"), a = await n("jest"), t) {
|
|
11
|
-
const { tsLintConfig: i } = await import("./ts.js");
|
|
12
|
-
e = i;
|
|
13
|
-
}
|
|
14
|
-
if (a) {
|
|
15
|
-
const { jestConf: i } = await import("./jest.js");
|
|
16
|
-
s = i;
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
jestConfigs: s,
|
|
20
|
-
tsConfigs: e
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
l as getConditionalPackages
|
|
25
|
-
};
|