-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8db582a
commit 62f284d
Showing
59 changed files
with
937 additions
and
1,440 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ node_modules | |
.vscode-test/ | ||
*.vsix | ||
.DS_Store | ||
.eslintcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
const { default: antfu, GLOB_SRC } = require('@antfu/eslint-config') | ||
|
||
module.exports = antfu( | ||
{ | ||
// Disable tests rules because we need to test with various setup | ||
test: false, | ||
// This replaces the old `.gitignore` | ||
ignores: [ | ||
'**/coverage', | ||
'**/*.snap', | ||
'**/bench.json', | ||
'**/fixtures', | ||
'**/test', | ||
'**/samples', | ||
], | ||
}, | ||
{ | ||
rules: { | ||
// prefer global Buffer to not initialize the whole module | ||
'node/prefer-global/buffer': 'off', | ||
'node/prefer-global/process': 'off', | ||
'no-empty-pattern': 'off', | ||
'antfu/indent-binary-ops': 'off', | ||
'unused-imports/no-unused-imports': 'error', | ||
'style/member-delimiter-style': [ | ||
'error', | ||
{ | ||
multiline: { delimiter: 'none' }, | ||
singleline: { delimiter: 'semi' }, | ||
}, | ||
], | ||
|
||
'ts/no-invalid-this': 'off', | ||
|
||
// TODO: migrate and turn it back on | ||
'ts/ban-types': 'off', | ||
|
||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
paths: ['path'], | ||
}, | ||
], | ||
|
||
'import/no-named-as-default': 'off', | ||
}, | ||
}, | ||
{ | ||
files: [`packages/*/*.{js,mjs,d.ts}`], | ||
rules: { | ||
'antfu/no-import-dist': 'off', | ||
}, | ||
}, | ||
{ | ||
files: [`packages/${GLOB_SRC}`], | ||
rules: { | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
paths: ['vitest', 'path'], | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
// these files define vitest as peer dependency | ||
files: [`packages/{coverage-*,ui,browser,web-worker}/${GLOB_SRC}`], | ||
rules: { | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
paths: ['path'], | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: [ | ||
`docs/${GLOB_SRC}`, | ||
], | ||
rules: { | ||
'style/max-statements-per-line': 'off', | ||
'import/newline-after-import': 'off', | ||
'import/first': 'off', | ||
'unused-imports/no-unused-imports': 'off', | ||
}, | ||
}, | ||
{ | ||
files: [ | ||
`docs/${GLOB_SRC}`, | ||
`packages/web-worker/${GLOB_SRC}`, | ||
`test/web-worker/${GLOB_SRC}`, | ||
], | ||
rules: { | ||
'no-restricted-globals': 'off', | ||
}, | ||
}, | ||
{ | ||
files: [`packages/vite-node/${GLOB_SRC}`], | ||
rules: { | ||
// false positive on "exports" variable | ||
'antfu/no-cjs-exports': 'off', | ||
}, | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import { describe, it } from "vitest"; | ||
import { describe, it } from 'vitest' | ||
|
||
describe("console", () => { | ||
it("basic", () => { | ||
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)) | ||
|
||
describe('console', () => { | ||
it('basic', () => { | ||
console.log([ | ||
"string", | ||
{ hello: "world" }, | ||
'string', | ||
{ hello: 'world' }, | ||
1234, | ||
/regex/g, | ||
true, | ||
false, | ||
null, | ||
]); | ||
}); | ||
|
||
it("async", async () => { | ||
console.log("1st"); | ||
await sleep(200); | ||
console.log("2nd"); | ||
await sleep(200); | ||
console.log("3rd"); | ||
}); | ||
}); | ||
]) | ||
}) | ||
|
||
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); | ||
it('async', async () => { | ||
console.log('1st') | ||
await sleep(200) | ||
console.log('2nd') | ||
await sleep(200) | ||
console.log('3rd') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { getJestProjects } from '@nx/jest'; | ||
import { getJestProjects } from '@nx/jest' | ||
|
||
export default { | ||
projects: getJestProjects(), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
const nxPreset = require('@nx/jest/preset').default; | ||
const nxPreset = require('@nx/jest/preset').default | ||
|
||
module.exports = { ...nxPreset }; | ||
module.exports = { ...nxPreset } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './lib/library'; | ||
export * from './lib/library' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { library } from './library'; | ||
import { library } from './library' | ||
|
||
describe('library', () => { | ||
it('should work', () => { | ||
expect(library()).toEqual('library'); | ||
}); | ||
}); | ||
expect(library()).toEqual('library') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export function library(): string { | ||
return 'library'; | ||
return 'library' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.