@meistrari/mise-en-place 1.0.1 → 1.0.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.
- package/eslint.ts +93 -1
- package/package.json +6 -1
package/eslint.ts
CHANGED
|
@@ -1 +1,93 @@
|
|
|
1
|
-
|
|
1
|
+
import antfu, { OptionsTypescript } from '@antfu/eslint-config'
|
|
2
|
+
// @ts-expect-error Missing types
|
|
3
|
+
import drizzle from 'eslint-plugin-drizzle'
|
|
4
|
+
import * as eslintPluginDiff from 'eslint-plugin-diff'
|
|
5
|
+
|
|
6
|
+
const isCI = process.env.CI === 'true'
|
|
7
|
+
|
|
8
|
+
// Enabling type-aware linting in CI is making the linting process too slow and
|
|
9
|
+
// even crashing sometimes due to memory limits.
|
|
10
|
+
// Thus, we only enable it for local development.
|
|
11
|
+
// We need to fix this, so we can have type-aware linting in CI as well.
|
|
12
|
+
function getTsConfig(): OptionsTypescript | undefined {
|
|
13
|
+
if (isCI) {
|
|
14
|
+
return undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
tsconfigPath: './tsconfig.json',
|
|
19
|
+
overridesTypeAware: {
|
|
20
|
+
'ts/no-floating-promises': 'error',
|
|
21
|
+
'ts/no-unnecessary-condition': 'error',
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default antfu(
|
|
27
|
+
{
|
|
28
|
+
stylistic: {
|
|
29
|
+
indent: 4,
|
|
30
|
+
|
|
31
|
+
// quotes: 'single',
|
|
32
|
+
// semi: false,
|
|
33
|
+
},
|
|
34
|
+
// Only lint changed lines when running in CI
|
|
35
|
+
// This speeds up the linting process significantly and also allows us to
|
|
36
|
+
// rollout new rules gradually.
|
|
37
|
+
...isCI
|
|
38
|
+
? {
|
|
39
|
+
processor: eslintPluginDiff.processors.ci,
|
|
40
|
+
}
|
|
41
|
+
: undefined,
|
|
42
|
+
typescript: getTsConfig(),
|
|
43
|
+
ignores: [
|
|
44
|
+
'.github',
|
|
45
|
+
'*.yaml',
|
|
46
|
+
'*.yml',
|
|
47
|
+
'*/**/storybook-static/',
|
|
48
|
+
'.devbox/',
|
|
49
|
+
'**/migrations/**/*.json',
|
|
50
|
+
'.wrangler',
|
|
51
|
+
'**/*.timestamp*',
|
|
52
|
+
'**/node_modules',
|
|
53
|
+
],
|
|
54
|
+
rules: {
|
|
55
|
+
'ts/strict-boolean-expressions': 'off',
|
|
56
|
+
'node/prefer-global/process': ['off', 'always'],
|
|
57
|
+
'ts/consistent-type-definitions': 'off',
|
|
58
|
+
'style/member-delimiter-style': ['off', {
|
|
59
|
+
multiline: {
|
|
60
|
+
delimiter: 'none',
|
|
61
|
+
},
|
|
62
|
+
singleline: {
|
|
63
|
+
delimiter: 'comma',
|
|
64
|
+
requireLast: true,
|
|
65
|
+
}
|
|
66
|
+
}],
|
|
67
|
+
'antfu/no-top-level-await': 'off',
|
|
68
|
+
'antfu/sort-imports': 'off',
|
|
69
|
+
'perfectionist/sort-imports': 'off',
|
|
70
|
+
'perfectionist/sort-named-imports': 'off',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
plugins: {
|
|
75
|
+
drizzle,
|
|
76
|
+
},
|
|
77
|
+
files: ['*.ts'],
|
|
78
|
+
rules: {
|
|
79
|
+
'drizzle/enforce-update-with-where': [
|
|
80
|
+
'error',
|
|
81
|
+
{
|
|
82
|
+
drizzleObjectName: ['db'],
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
'drizzle/enforce-delete-with-where': [
|
|
86
|
+
'error',
|
|
87
|
+
{
|
|
88
|
+
drizzleObjectName: ['db'],
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meistrari/mise-en-place",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postinstall": "test -f Makefile || echo 'include ./node_modules/@meistrari/mise-en-place/Makefile' > Makefile"
|
|
11
11
|
},
|
|
12
|
+
"exports": {
|
|
13
|
+
"./eslint": {
|
|
14
|
+
"import": "./eslint.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
12
17
|
"keywords": [],
|
|
13
18
|
"author": "",
|
|
14
19
|
"license": "ISC",
|