Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Program(path, {filename, opts}) {
const options = parseOptions({
filename,
options: opts,
});
transform(
path.container,
code,
options,
);
},
},
'use strict';
const rule = require('./putout');
const {RuleTester} = require('eslint');
const putout = require('putout');
const options = putout.parseOptions();
const {rules} = options;
const ruleTester = new RuleTester({
parserOptions: {
ecmaVersion: 2019,
},
});
ruleTester.run('putout', rule, {
valid: [{
options: [{
...options,
rules: {
...rules,
'remove-unused-variables': false,
'strict-mode': false,
Program(node) {
const name = context.getFilename();
const options = getContextOptions(context);
const resultOptions = parseOptions({
name,
options,
});
if (ignores(cwd, name, resultOptions))
return;
const text = context
.getSourceCode()
.getText(node);
const ast = parse(text);
const places = findPlaces(ast, text, resultOptions);
for (const {rule, message, position} of places) {
context.report({