Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
chore: use swc for tests instead of Babel#4584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
7e0fada
214ad17
ea91f08
9437439
7f86a69
ff8963f
f68e0ed
6078abe
b2dafa8
9216077
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
// @ts-check | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
module.exports = { | ||
collectCoverage: false, | ||
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], | ||
coverageReporters: ['text-summary', 'lcov'], | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
resolver: '<rootDir>/../../tests/jest-resolver.js', | ||
transform: { | ||
'^.+\\.(t|j)sx?$': [ | ||
'@swc/jest', | ||
{ | ||
jsc: { | ||
target: 'es2019', | ||
}, | ||
}, | ||
], | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -55,16 +55,14 @@ | ||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" | ||
}, | ||
"devDependencies": { | ||
bradzacher marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
"@commitlint/cli": "^16.0.1", | ||
"@commitlint/config-conventional": "^16.0.0", | ||
"@nrwl/cli": "13.0.2", | ||
"@nrwl/nx-cloud": "12.5.1", | ||
"@nrwl/tao": "13.0.2", | ||
"@nrwl/workspace": "13.0.2", | ||
"@swc/core": "^1.2.143", | ||
"@swc/jest": "^0.2.17", | ||
"@types/debug": "^4.1.7", | ||
"@types/eslint-visitor-keys": "^1.0.0", | ||
"@types/glob": "^7.2.0", | ||
@@ -81,6 +79,7 @@ | ||
"@types/tmp": "^0.2.2", | ||
"all-contributors-cli": "^6.20.0", | ||
"cross-env": "^7.0.3", | ||
"cross-fetch": "^3.1.4", | ||
"cspell": "^5.12.3", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"downlevel-dts": "^0.9.0", | ||
@@ -100,12 +99,10 @@ | ||
"make-dir": "^3.1.0", | ||
"markdownlint-cli": "^0.29.0", | ||
"ncp": "^2.0.0", | ||
"prettier": "^2.5.0", | ||
"pretty-format": "^27.3.1", | ||
"rimraf": "^3.0.2", | ||
"tmp": "^0.2.1", | ||
"ts-node": "^10.4.0", | ||
"tslint": "^6.1.3", | ||
"typescript": ">=3.3.1 <4.6.0" | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -85,57 +85,54 @@ export default util.createRule({ | ||
}), | ||
...(option === 'type' && { | ||
TSInterfaceDeclaration(node): void { | ||
const fix = isCurrentlyTraversedNodeWithinModuleDeclaration() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. These changes don't do anything other than get us aroundswc-project/swc#3672 | ||
? null | ||
: (fixer: TSESLint.RuleFixer): TSESLint.RuleFix[] => { | ||
const typeNode = node.typeParameters ?? node.id; | ||
const fixes: TSESLint.RuleFix[] = []; | ||
const firstToken = sourceCode.getTokenBefore(node.id); | ||
if (firstToken) { | ||
fixes.push(fixer.replaceText(firstToken, 'type')); | ||
fixes.push( | ||
fixer.replaceTextRange( | ||
[typeNode.range[1], node.body.range[0]], | ||
' = ', | ||
), | ||
); | ||
} | ||
if (node.extends) { | ||
node.extends.forEach(heritage => { | ||
const typeIdentifier = sourceCode.getText(heritage); | ||
fixes.push( | ||
fixer.insertTextAfter(node.body, ` & ${typeIdentifier}`), | ||
); | ||
}); | ||
} | ||
if ( | ||
node.parent?.type === AST_NODE_TYPES.ExportDefaultDeclaration | ||
) { | ||
fixes.push( | ||
fixer.removeRange([node.parent.range[0], node.range[0]]), | ||
fixer.insertTextAfter( | ||
node.body, | ||
`\nexport default ${node.id.name}`, | ||
), | ||
); | ||
} | ||
return fixes; | ||
}; | ||
context.report({ | ||
node: node.id, | ||
messageId: 'typeOverInterface', | ||
/** | ||
* remove automatically fix when the interface is within a declare global | ||
* @see {@link https://github.com/typescript-eslint/typescript-eslint/issues/2707} | ||
*/ | ||
fix, | ||
}); | ||
}, | ||
}), | ||
Uh oh!
There was an error while loading.Please reload this page.