@putout/quick-lint
v1.4.0
Published
quick-lint-js as library
Downloads
15,494
Maintainers
Readme
Quick Lint
quick-lint-js as library.
Install
npm i @putout/quick-lint --save
API
quickLint(source: string, options: Options)
interface Options {
isJSX: boolean;
isTS: boolean;
startLine: number;
}
const quickLint = require('@putout/quick-lint');
const option = `
function x() {
await m();
}
`;
quickLint(source, {
isJSX: true,
isTS: false,
startLine: 0, // default
});
// returns
[{
rule: 'parser (quick-lint-js)',
message: '\'await\' is only allowed in async functions',
position: {
line: 2,
column: 8,
},
}, {
rule: 'parser (quick-lint-js)',
message: 'use of undeclared variable: m',
position: {
line: 2,
column: 14,
},
}];
License
MIT