https://github.com/mysteryven/eslint-test-case-to-oxc
https://github.com/mysteryven/eslint-test-case-to-oxc
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mysteryven/eslint-test-case-to-oxc
- Owner: mysteryven
- License: mit
- Created: 2023-04-08T15:31:31.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-09T14:14:54.000Z (about 2 years ago)
- Last Synced: 2025-03-28T17:19:50.754Z (2 months ago)
- Language: TypeScript
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ESLint-test-case-to-oxc
Migrate ESList test cases to Oxc.
## Install
```sh
npm i eslint-test-case-to-oxc
```## Usage
```sh
npm exec trans rule-name
```Input:
```sh
npm exec trans no-debugger
```Result:
```sh
fetching no-debugger rule from ESlint repo...
---- result ----
#[test]
fn test() {use crate::tester::Tester;
let pass = vec![
("var test = { debugger: 1 }; test.debugger;", None)
];
let fail = vec![
("if (foo) debugger", None)
];Tester::new(NoDebugger::NAME, pass, fail).test_and_snapshot();
}---- end ----
copied to clipboard!
```Not support all cases. for example, `eqeqeq` is not supported because it is only determined at runtime:
```js
ruleTester.run("eqeqeq", rule, {
valid: [ ... ],
invalid: [ ... ].map(invalidCase => Object.assign({ output: null }, invalidCase))
});
```