Skip to content

Commit 77347fc

Browse files
authored
Merge pull request #4974 from L-Mario564/oxlint
Oxlint & Dprint
2 parents e822cd4 + ee9e02a commit 77347fc

File tree

73 files changed

+1459
-2175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1459
-2175
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
2-
.vscode
32
dist
43
dist.new
54
*.tsbuildinfo

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint-staged

.oxlintrc.json

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"plugins": ["import"],
3+
"jsPlugins": [
4+
"./eslint/eslint-plugin-drizzle-internal/index.js"
5+
],
6+
"rules": {
7+
"typescript/consistent-type-imports": [
8+
"error",
9+
{
10+
"disallowTypeAnnotations": true,
11+
"fixStyle": "separate-type-imports"
12+
}
13+
],
14+
"typescript/no-import-type-side-effects": "error",
15+
"import/no-cycle": "error",
16+
"import/no-self-import": "error",
17+
"import/no-empty-named-blocks": "error",
18+
"import/no-duplicates": "error",
19+
"import/extensions": [
20+
"error",
21+
"always",
22+
{
23+
"ignorePackages": true
24+
}
25+
],
26+
"typescript/no-explicit-any": "off",
27+
"typescript/no-non-null-assertion": "off",
28+
"typescript/no-namespace": "off",
29+
"no-unused-vars": [
30+
"error",
31+
{
32+
"argsIgnorePattern": "^_",
33+
"varsIgnorePattern": "^_"
34+
}
35+
],
36+
"ban-types": [
37+
"error",
38+
{
39+
"extendDefaults": true,
40+
"types": {
41+
"{}": false
42+
}
43+
}
44+
],
45+
"typescript/no-this-alias": "off",
46+
"typescript/no-var-requires": "off",
47+
"unicorn/prefer-node-protocol": "off",
48+
"unicorn/prefer-top-level-await": "off",
49+
"unicorn/catch-error-name": "off",
50+
"unicorn/no-null": "off",
51+
"unicorn/numeric-separators-style": "off",
52+
"unicorn/explicit-length-check": "off",
53+
"unicorn/filename-case": "off",
54+
"unicorn/no-array-reduce": "off",
55+
"unicorn/no-nested-ternary": "off",
56+
"unicorn/no-useless-undefined": [
57+
"error",
58+
{
59+
"checkArguments": false
60+
}
61+
],
62+
"unicorn/no-this-assignment": "off",
63+
"unicorn/empty-brace-spaces": "off",
64+
"unicorn/no-thenable": "off",
65+
"unicorn/consistent-function-scoping": "off",
66+
"unicorn/prefer-type-error": "off",
67+
"eqeqeq": "error",
68+
"unicorn/no-instanceof-builtins": "error",
69+
"unicorn/prefer-string-replace-all": "off",
70+
"unicorn/no-process-exit": "off",
71+
"typescript/ban-ts-comment": "off",
72+
"typescript/no-empty-interface": "off",
73+
"typescript/no-unsafe-declaration-merging": "off",
74+
"no-inner-declarations": "off",
75+
"drizzle-internal/no-instanceof": "error",
76+
"drizzle-internal/require-entity-kind": "error"
77+
},
78+
"overrides": [
79+
{
80+
"files": ["**/tests/**/*.ts", "**/type-tests/**/*.ts", "**/typeperf-test/**/*.ts"],
81+
"rules": {
82+
"import/extensions": "off",
83+
"drizzle-internal/no-instanceof": "off"
84+
}
85+
},
86+
{
87+
"files": ["**/type-tests/**/*.ts", "**/integration-tests/tests/**/*.ts"],
88+
"rules": {
89+
"no-unused-expressions": "off"
90+
}
91+
},
92+
{
93+
"files": ["eslint-plugin-drizzle/**/*"],
94+
"rules": {
95+
"import/extensions": "off"
96+
}
97+
}
98+
],
99+
"ignorePatterns": [
100+
"node_modules",
101+
"dist",
102+
"dist-dts",
103+
"examples",
104+
"**/*.js",
105+
"**/*.mjs",
106+
"**/*.cjs",
107+
"**/playground",
108+
"integration-tests/tests/prisma/*/client",
109+
"integration-tests/tests/prisma/*/drizzle",
110+
"drizzle-kit/*"
111+
]
112+
}

.vscode/settings.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"editor.defaultFormatter": "dprint.dprint",
4+
"[javascript]": {
5+
"editor.defaultFormatter": "dprint.dprint"
6+
},
7+
"[typescript]": {
8+
"editor.defaultFormatter": "dprint.dprint"
9+
},
10+
"[json]": {
11+
"editor.defaultFormatter": "dprint.dprint"
12+
},
13+
"[markdown]": {
14+
"editor.defaultFormatter": "dprint.dprint"
15+
},
16+
"dprint.path": "node_modules/.bin/dprint"
17+
}

attw-fork/src/createPackage.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,7 @@ export async function resolveTypesPackageForPackage(
199199
],
200200
options,
201201
);
202-
} catch {
203-
null;
204-
}
202+
} catch {}
205203

206204
return undefined;
207205
}

attw-fork/src/internal/esm/cjsNamespace.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ export function getCjsModuleNamespace(fs: Package, file: URL, seen = new Set<str
2222
const reexported = getCjsModuleNamespace(fs, url, seen);
2323
for (const name of reexported) exports.add(name);
2424
}
25-
} catch {
26-
null;
27-
}
25+
} catch {}
2826
}
2927

3028
return exports;

attw-fork/src/internal/getEntrypointInfo.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ function getProxyDirectories(rootDir: string, fs: Package) {
9494
const proxyDir = '.' + file.slice(rootDir.length, file.lastIndexOf('/'));
9595
proxyDirectories.push(proxyDir);
9696
}
97-
} catch {
98-
null;
99-
}
97+
} catch {}
10098
}
10199
}
102100

clean.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
import { existsSync, lstatSync, readdirSync, rmSync } from 'node:fs';
2-
import { join } from 'node:path';
1+
// import { existsSync, lstatSync, readdirSync, rmSync } from 'node:fs';
2+
// import { join } from 'node:path';
33

4-
const printTree = (path: string, indentation: number) => {
5-
for (const it of readdirSync(path)) {
6-
if (it === 'node_modules') continue;
7-
if (it === '.git') continue;
8-
if (it === '.github') continue;
9-
if (it === '.turbo') continue;
10-
if (it === 'dist') continue;
4+
// const printTree = (path: string, indentation: number) => {
5+
// for (const it of readdirSync(path)) {
6+
// if (it === 'node_modules') continue;
7+
// if (it === '.git') continue;
8+
// if (it === '.github') continue;
9+
// if (it === '.turbo') continue;
10+
// if (it === 'dist') continue;
1111

12-
const full = join(path, it);
13-
const stat = existsSync(full) ? lstatSync(full) : undefined;
14-
if (!stat) continue;
12+
// const full = join(path, it);
13+
// const stat = existsSync(full) ? lstatSync(full) : undefined;
14+
// if (!stat) continue;
1515

16-
if (stat.isDirectory()) {
17-
printTree(full, indentation + 1);
18-
} else {
19-
if (
20-
full.endsWith('.js')
21-
&& existsSync(full.replace('.js', '.js.map'))
22-
&& existsSync(full.replace('.js', '.ts'))
23-
) {
24-
console.log(full);
25-
rmSync(full);
26-
rmSync(full.replace('.js', '.js.map'));
27-
}
28-
}
29-
}
30-
};
16+
// if (stat.isDirectory()) {
17+
// printTree(full, indentation + 1);
18+
// } else {
19+
// if (
20+
// full.endsWith('.js')
21+
// && existsSync(full.replace('.js', '.js.map'))
22+
// && existsSync(full.replace('.js', '.ts'))
23+
// ) {
24+
// console.log(full);
25+
// rmSync(full);
26+
// rmSync(full.replace('.js', '.js.map'));
27+
// }
28+
// }
29+
// }
30+
// };
3131

3232
// I've accidentally ran tsc which generated .d.ts files for all ts files in repo
3333
// printTree(".");

drizzle-arktype/src/column.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { CONSTANTS } from './constants.ts';
1414

1515
export const literalSchema = type.string.or(type.number).or(type.boolean).or(type.null);
1616
export const jsonSchema = literalSchema.or(type.unknown.as<any>().array()).or(type.object.as<Record<string, any>>());
17-
export const bufferSchema = type.unknown.narrow((value) => value instanceof Buffer).as<Buffer>().describe( // eslint-disable-line no-instanceof/no-instanceof
17+
export const bufferSchema = type.unknown.narrow((value) => value instanceof Buffer).as<Buffer>().describe( // oxlint-disable-line drizzle-internal/no-instanceof
1818
'a Buffer instance',
1919
);
2020

drizzle-arktype/vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import tsconfigPaths from 'vite-tsconfig-paths';
2-
import { defineConfig } from 'vitest/config';
2+
import { defineConfig } from 'vitest/config.js';
33

44
export default defineConfig({
55
test: {

0 commit comments

Comments
 (0)