putout v24.4.0
Let's test ESLint
The baby looks at things all day without winking; that is because his eyes are not focused on any particular object. He goes without knowing where he is going, and stops without knowing what he is doing. He merges himself within the surroundings and moves along with it. These are the principles of mental hygiene.”
― Chuang-Tzu
Hi folks!
Now you can test ESLint in a simplest possible way, using @putout/test.
All you need is create test:
import {createTest} from '@putout/test/eslint';
const test = createTest(import.meta.url);And process:
test('test: eslint: transform', async ({process}) => {
await process('operator-linebreak');
});When you want to pass options:
test('test: eslint: transform', async ({process}) => {
await process('operator-linebreak', {
rules: {
'putout/putout': {
rules: {
'convert-esm-to-commonjs': 'on',
},
},
},
});
});When you want to compare found places:
test('eslint-config: operator-line-break', async ({comparePlaces}) => {
await comparePlaces('operator-linebreak', [{
"message": "There should be no line break before or after '='.",
"position": {
"column": 1,
"line": 2,
},
"rule": "operator-linebreak (eslint)",
}]);
});That's all for today :)!
🔥 feature
- (putout) cli: move out runner
- (@putout/eslint-config) padding-line-between-statements: add import
- (@putout/eslint-config) padding-line-between-statements: add export
- (@putout/eslint-config) enable operator-linebreak
- (@putout/test) add ESLint support
