Fixed yarn lint errors
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
// Test Suite for removePlugin command.
|
||||
/*
|
||||
* Copyright 2020 Spotify AB
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fse from 'fs-extra';
|
||||
import path from 'path';
|
||||
import {
|
||||
// removeExportStatementFromPlugins,
|
||||
removePluginDependencyFromApp,
|
||||
//removePluginDirectory,
|
||||
} from './removePlugin';
|
||||
import { removePluginDependencyFromApp } from './removePlugin';
|
||||
|
||||
const rootDir = fse.realpathSync(process.cwd().replace('/cli', ''));
|
||||
const BACKSTAGE = `@backstage`;
|
||||
@@ -21,7 +31,9 @@ describe('removePlugin', () => {
|
||||
const testPluginName = 'yarn-test-package';
|
||||
const testPluginPackage = `${BACKSTAGE}/plugin-${testPluginName}`;
|
||||
|
||||
let packageFileContents = JSON.parse(fse.readFileSync(packageFile, 'utf8'));
|
||||
const packageFileContents = JSON.parse(
|
||||
fse.readFileSync(packageFile, 'utf8'),
|
||||
);
|
||||
packageFileContents.dependencies[testPluginPackage] = '0.1.0';
|
||||
|
||||
it('should remove plugin dependency from /packages/app/package.json', async () => {
|
||||
@@ -45,9 +57,7 @@ describe('removePlugin', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Still to implement
|
||||
// test remove plugin dependency from app
|
||||
|
||||
// remove plugin from directory
|
||||
|
||||
// remove symlink from lerna scope
|
||||
|
||||
@@ -33,7 +33,7 @@ export const checkExists = async (rootDir: string, pluginName: string) => {
|
||||
color: 'green',
|
||||
}).start();
|
||||
try {
|
||||
let pathExist = await fse.pathExists(destination);
|
||||
const pathExist = await fse.pathExists(destination);
|
||||
if (pathExist) {
|
||||
spinner.succeed();
|
||||
console.log(
|
||||
@@ -116,6 +116,9 @@ export const removeStatementContainingID = async (file: string, ID: string) => {
|
||||
throw new Error(`File was not modified.`);
|
||||
};
|
||||
|
||||
const capitalize = (str: string): string =>
|
||||
str.charAt(0).toUpperCase() + str.slice(1);
|
||||
|
||||
export const removeExportStatementFromPlugins = async (
|
||||
pluginsFile: string,
|
||||
pluginName: string,
|
||||
@@ -224,9 +227,6 @@ export const removePluginDependencyFromApp = async (
|
||||
}
|
||||
};
|
||||
|
||||
const capitalize = (str: string): string =>
|
||||
str.charAt(0).toUpperCase() + str.slice(1);
|
||||
|
||||
const removePlugin = async () => {
|
||||
const questions: Question[] = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user