putout v23.7.0
Simplified ESLint API
Whip, rope, person, and Ox -
all merge in No Thing.
This heaven is so vast,
no message can stain it.
How may a snowflake exist
in a raging fire.
Here are the footprints of
the Ancestors.
(c) Zen Ten Bulls
Hi folks :)!
ESLint begins his work as a formatter when 🐊Putout done his transformations. That's why it used a lot in different parts of application, for testing purpose and using API in a simplest possible way. You can access it with:
import {eslint} from 'putout/eslint';Usage as simple as:
const [source, places] = await eslint({
name: 'hello.js',
code: `const t = 'hi'\n`,
fix: false,
});In a similar to 🐊Putout way.
☝️ The only difference is 🐊Putout return object with code and places properties
Also it has a name property it used by ESLint to calculate configuration file.
This API doesn't suppose to came in 🌴 Public Space, anyways it is already used in eslint-plugin-putout to test plugins, so why not :)? Anyways it's signature didn't changed from the beginning.
⚙️ Config
And starting from today you can override any ESLint options with help of config property 🎉
const [source, places] = await eslint({
name: 'hello.js',
code: `const t = 'hi'\n`,
fix: false,
config: {
extends: [
'plugin:putout/recommended'
]
}
});That's all for today guys! Have a nice day!
🐞 fix
- (@putout/plugin-nodejs) convert-dirname-to-url
🔥 feature
- (putout) eslint: add ability to pass config
- (eslint-plugin-putout) safe: disable remove-newline-from-empty-objects
- (eslint-plugin-putout) remove-newline-from-empty-object: add support of inner comments
- (@putout/plugin-remove-empty) add support of export
- (@putout/plugin-remove-empty) simplify namings
