import { SnapshotCreator } from 'eslint-snapshot-tester';
import { semi } from 'eslint/rules/semi';
const eslintOptions = {
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
},
parser: '@typescript-eslint/parser',
};
const snapshotCreator = new SnapshotCreator(eslintOptions);
const code = "const a = 1";
const { snapshot } = snapshotCreator
.mark({ code, ruleName: 'semi', rule: semi })
.render();
const { snapshot } = snapshotCreator
.mark({ code, ruleName: 'semi', rule: semi })
.withOptions(["always"], "warn")
.render();
const { snapshot } = snapshotCreator
.mark({ code, ruleName: 'semi', rule: semi })
.overrideConfig({ settings: { foo: 'foo' } })
.render();
const { snapshot } = snapshotCreator
.mark({ code, ruleName: 'semi', rule: semi })
.withFileName('filename.ts')
.render();
-
Notifications
You must be signed in to change notification settings - Fork 1
Create snapshot for eslint
License
fa93hws/eslint-snapshot-test
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Create snapshot for eslint
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published