Skip to content

Commit

Permalink
feat(plugin): Migrate deprecated CLIEngine -> ESLint constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Sep 25, 2020
1 parent fd658bb commit e8c14e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/eslint-plugin-zillow/lib/get-computed-config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
'use strict';

const { CLIEngine } = require('eslint');
const { ESLint } = require('eslint');

module.exports = getComputedConfig;

function getComputedConfig(baseConfig) {
const cli = new CLIEngine({
async function getComputedConfig(baseConfig) {
const engine = new ESLint({
useEslintrc: false,
allowInlineConfig: false,
baseConfig,
});

const computed = cli.getConfigForFile('index.js');
const computed = await engine.calculateConfigForFile('index.js');

// remove unnecessary fields
delete computed.filePath;
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-zillow/lib/render-configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async function main() {
}

async function renderConfig(name, config, overrides) {
const computedConfig = getComputedConfig(config);
const computedConfig = await getComputedConfig(config);
const wrappedConfig = wrapInPlugin(computedConfig, overrides);
const targetPath = path.join(__dirname, `configs/${name}.json`);

Expand Down

0 comments on commit e8c14e3

Please sign in to comment.