Skip to content

Commit

Permalink
chore: update and fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsadhu committed Jul 30, 2024
1 parent f3c4c74 commit 36830b1
Show file tree
Hide file tree
Showing 24 changed files with 51 additions and 37 deletions.
18 changes: 11 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"extends": ["airbnb-base", "prettier"],
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"rules": {
"strict": [0, "global"],
"class-methods-use-this": [0],
"no-restricted-syntax": [0],
"default-param-last": [0],
"import/extensions": [0]
"env": { "es6": true, "node": true },
"parser": "@babel/eslint-parser",
"ignorePatterns": [
"build",
"public"
],
"parserOptions": {
"requireConfigFile": false,
"ecmaVersion": 2020,
"sourceType": "module"
}
}
2 changes: 1 addition & 1 deletion classes/alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ export default class Alias {
}
}
}
};
}
2 changes: 1 addition & 1 deletion classes/integrity.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ export default class Integrity {
);
}
}
};
}
2 changes: 1 addition & 1 deletion classes/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ export default class Login {
}
}
}
};
}
2 changes: 1 addition & 1 deletion classes/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ export default class Meta {
return false;
}
}
};
}
2 changes: 1 addition & 1 deletion classes/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ export default class Ping {
}
}
}
};
}
2 changes: 1 addition & 1 deletion classes/publish/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ export default class PublishMap {
}
}
}
};
}
2 changes: 1 addition & 1 deletion classes/publish/package/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ export default class Publish {
...response,
};
}
};
}
2 changes: 1 addition & 1 deletion classes/publish/package/tasks/check-bundle-sizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export default class CheckBundleSizes extends Task {
throw new Error(`Failed to check bundle sizes: ${err.message}`);
}
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ export default class CheckIfAlreadyPublished extends Task {

return localHash;
}
};
}
2 changes: 1 addition & 1 deletion classes/publish/package/tasks/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export default class Cleanup extends Task {
.forEach((file) => rimraf.sync(join(path, file)));
}
}
};
}
2 changes: 1 addition & 1 deletion classes/publish/package/tasks/create-temp-directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export default class CreateTempDir extends Task {
throw new IOError('Unable to create temp dir', err);
}
}
};
}
2 changes: 1 addition & 1 deletion classes/publish/package/tasks/create-zip-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ export default class CreateZipFile extends Task {
throw new Error(`Unable to create zip file: ${err.message}`);
}
}
};
}
2 changes: 1 addition & 1 deletion classes/publish/package/tasks/dry-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export default class DryRun extends Task {

return files;
}
};
}
2 changes: 1 addition & 1 deletion classes/publish/package/tasks/save-metafile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export default class SaveMetaFile extends Task {
);
}
}
};
}
2 changes: 1 addition & 1 deletion classes/publish/package/tasks/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default class Task {
this.path = options.path;
this.config = options.config;
}
};
}
2 changes: 1 addition & 1 deletion classes/publish/package/tasks/validate-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ export default class ValidateInput extends Task {
throw new ValidationError('Parameter "dryRun" is not valid');
}
}
};
}
2 changes: 1 addition & 1 deletion classes/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ export default class Version {
log.debug(` ==> ${newVersion}`);
return newVersion;
}
};
}
14 changes: 13 additions & 1 deletion commands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,16 @@ import * as ping from './ping.js';
import * as publish from './publish.js';
import * as version from './version.js';

export const commands = [ init, integrity, login, mapAlias, map, meta, npmAlias, packageAlias, ping, publish, version ];
export const commands = [
init,
integrity,
login,
mapAlias,
map,
meta,
npmAlias,
packageAlias,
ping,
publish,
version,
];
2 changes: 1 addition & 1 deletion commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ const handler = async (argv) => {
spinner.stopAndPersist();
};

export { command, aliases, describe, builder, handler };
export { command, aliases, describe, builder, handler };
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import { commands } from './commands/index.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const { version } = JSON.parse(readFileSync(join(__dirname, './package.json'), { encoding: 'utf-8' }));
const { version } = JSON.parse(
readFileSync(join(__dirname, './package.json'), { encoding: 'utf-8' }),
);
const greeting = chalk.white.bold(`Eik CLI (v${version})`);

const boxenOptions = {
Expand Down Expand Up @@ -45,4 +47,4 @@ yargs(hideBin(process.argv))
.wrap(150)
.version(false)
.help()
.parse();
.parse();
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.0.39",
"description": "CLI tool for publishing assets to an Eik server",
"main": "./classes/index.js",
"type": "module",
"type": "module",
"bin": {
"eik": "index.js"
},
Expand Down Expand Up @@ -55,6 +55,7 @@
"yargs-parser": "21.1.1"
},
"devDependencies": {
"@babel/eslint-parser": "^7.25.1",
"@eik/core": "1.2.28",
"@eik/service": "1.2.98",
"@semantic-release/changelog": "6.0.3",
Expand Down
9 changes: 2 additions & 7 deletions test/fixtures/client-with-bare-imports.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
/* eslint-disable import/no-unresolved */

'use strict';

/* eslint-disable no-undef */
// @ts-nocheck
import scrollIntoView from 'scroll-into-view-if-needed';

const main = () => {
// eslint-disable-next-line no-undef
const node = document.getElementById('hero');

scrollIntoView(node, {
scrollMode: 'if-needed',
block: 'nearest',
Expand Down
2 changes: 1 addition & 1 deletion utils/get-cwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ const av = yargs(process.argv.slice(2));
*/
export default function getCWD() {
return av.cwd || av.c || process.cwd();
};
}

0 comments on commit 36830b1

Please sign in to comment.