lint(curly): consistent use of curly brackets in codebase (#3584)
This commit is contained in:
1 parent
9ae3d9f769
commit
5d435424e2
113 files changed
+1501
-1056
No files matched your search
@@ -10,7 +10,7 @@ import {
|
||||
initGit,
|
||||
} from './utils/index.js';
|
||||
|
||||
const createPackage = async (options) => {
|
||||
const createPackage = async options => {
|
||||
const { packageType } = options; // extension or mode
|
||||
|
||||
if (fs.existsSync(options.targetDir)) {
|
||||
|
||||
@@ -22,7 +22,9 @@ const createDirectoryContents = (
|
||||
const contents = fs.readFileSync(origFilePath, 'utf8');
|
||||
|
||||
// Rename
|
||||
if (file === '.npmignore') file = '.gitignore';
|
||||
if (file === '.npmignore') {
|
||||
file = '.gitignore';
|
||||
}
|
||||
|
||||
const writePath = `${targetDirPath}/${file}`;
|
||||
fs.writeFileSync(writePath, contents, 'utf8');
|
||||
|
||||
@@ -11,7 +11,7 @@ export default async function findRequiredOhifExtensionsForMode(yarnInfo) {
|
||||
const dependencies = [];
|
||||
const ohifExtensions = [];
|
||||
|
||||
Object.keys(peerDependencies).forEach((packageName) => {
|
||||
Object.keys(peerDependencies).forEach(packageName => {
|
||||
dependencies.push({
|
||||
packageName,
|
||||
version: peerDependencies[packageName],
|
||||
|
||||
@@ -77,14 +77,14 @@ function getVersion(json, version) {
|
||||
const [majorVersion] = version
|
||||
.split('^')[1]
|
||||
.split('.')
|
||||
.map((v) => parseInt(v));
|
||||
.map(v => parseInt(v));
|
||||
|
||||
// Find the version that matches the major version, but is the latest minor version
|
||||
versions
|
||||
.filter((version) => parseInt(version.split('.')[0]) === majorVersion)
|
||||
.filter(version => parseInt(version.split('.')[0]) === majorVersion)
|
||||
.sort((a, b) => {
|
||||
const [majorA, minorA, patchA] = a.split('.').map((v) => parseInt(v));
|
||||
const [majorB, minorB, patchB] = b.split('.').map((v) => parseInt(v));
|
||||
const [majorA, minorA, patchA] = a.split('.').map(v => parseInt(v));
|
||||
const [majorB, minorB, patchB] = b.split('.').map(v => parseInt(v));
|
||||
|
||||
if (majorA === majorB) {
|
||||
if (minorA === minorB) {
|
||||
@@ -110,13 +110,16 @@ function validate(packageName, version, keyword) {
|
||||
|
||||
// Gets the registry of the package. Scoped packages may not be using the global default.
|
||||
const registryUrlOfPackage = registryUrl(scope);
|
||||
let options = {}
|
||||
if (process.env.NPM_TOKEN){
|
||||
let options = {};
|
||||
if (process.env.NPM_TOKEN) {
|
||||
options['headers'] = {
|
||||
'Authorization': `Bearer ${process.env.NPM_TOKEN}`,
|
||||
}
|
||||
Authorization: `Bearer ${process.env.NPM_TOKEN}`,
|
||||
};
|
||||
}
|
||||
const response = await fetch(`${registryUrlOfPackage}${packageName}`, options);
|
||||
const response = await fetch(
|
||||
`${registryUrlOfPackage}${packageName}`,
|
||||
options
|
||||
);
|
||||
const json = await response.json();
|
||||
|
||||
if (json.error && json.error === NOT_FOUND) {
|
||||
|
||||
Reference in new issue
Block a user