Skip to content

Commit

Permalink
style(eslint): fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li authored Jun 7, 2023
1 parent 34f257b commit bb03108
Show file tree
Hide file tree
Showing 37 changed files with 34,015 additions and 11,004 deletions.
108 changes: 54 additions & 54 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
module.exports = {
"env": {
"browser": true,
"es2022": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jsonc/recommended-with-jsonc",
"plugin:jsonc/recommended-with-json",

],
"parser": "@typescript-eslint/parser",
overrides: [
{
files: ["*.json"],
parser: "jsonc-eslint-parser"
},
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"jsonc/sort-keys": [
"error",
"asc", {
"caseSensitive": false,
"natural": false
}
],
"@typescript-eslint/ban-ts-comment": "off"
}
};
module.exports = {
"env": {
"browser": true,
"es2022": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jsonc/recommended-with-jsonc",
"plugin:jsonc/recommended-with-json",

],
"parser": "@typescript-eslint/parser",
overrides: [
{
files: ["*.json"],
parser: "jsonc-eslint-parser"
},
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"jsonc/sort-keys": [
"error",
"asc", {
"caseSensitive": false,
"natural": false
}
],
"@typescript-eslint/ban-ts-comment": "off"
}
};
12 changes: 6 additions & 6 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-typescript'
]
};
module.exports = {
presets: [
["@babel/preset-env", {targets: {node: "current"}}],
"@babel/preset-typescript"
]
};
244 changes: 122 additions & 122 deletions commit-and-tag-version.js
Original file line number Diff line number Diff line change
@@ -1,122 +1,122 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { Command, Option } = require("commander");
const { readFileSync, writeFileSync } = require("fs");
const commitAndTagVersion = require("standard-version");
const dedent = require("dedent");
const c = require("ansi-colors");
const program = new Command();

c.theme({
danger: c.red,
dark: c.dim.gray,
disabled: c.gray,
em: c.italic,
heading: c.bold.underline,
info: c.cyan,
muted: c.dim,
primary: c.blue,
strong: c.bold,
success: c.green.bold,
underline: c.underline,
warning: c.yellow.underline,
});

program
.description("Bump version and create a new tag")
.option("-b, --beta", "Pre-release version")
.option("--dry-run", "Dry run")
.addOption(
new Option("-r, --release-as <size>", "release type version").choices([
"major",
"minor",
"patch",
])
);

program.parse();
const opt = program.opts();

const betaMsg = opt.beta ? c.em("- Pre-release\n\t") : "";
const dryRunMsg = opt.dryRun ? c.em("- Dry run\n\t") : "";
const releaseAsMsg = opt.releaseAs
? c.em(`- Release as ${c.underline(opt.releaseAs)}`)
: "";

const msg = dedent(`
${c.heading("Options :")}
${betaMsg}${dryRunMsg}${releaseAsMsg}
`);

console.log(msg);
console.log();

if (opt.beta) {
console.log(`${c.bold.green(">")} ${c.info.underline("Bumping beta version...")}`);
console.log();
const bumpFiles = [
{
filename: "manifest-beta.json",
type: "json",
},
{
filename: "package.json",
type: "json",
},
{
filename: "package-lock.json",
type: "json",
},
];
commitAndTagVersion({
infile: "CHANGELOG-beta.md",
bumpFiles: bumpFiles,
prerelease: "",
dryRun: opt.dryRun,
tagPrefix: "",
})
.then(() => {
console.log("Done");
})
.catch((err) => {
console.error(err);
});
} else {
const versionBumped = opt.releaseAs
? c.info("Release as " + c.underline(opt.releaseAs))
: c.info("Release");
console.log(`${c.bold.green(">")} ${c.underline(versionBumped)}`);
console.log();

const bumpFiles = [
{
filename: "manifest-beta.json",
type: "json",
},
{
filename: "package.json",
type: "json",
},
{
filename: "package-lock.json",
type: "json",
},
{
filename: "manifest.json",
type: "json",
}
];


commitAndTagVersion({
infile: "CHANGELOG.md",
bumpFiles: bumpFiles,
dryRun: opt.dryRun,
tagPrefix: "",
})
.then(() => {
console.log("Done");
})
.catch((err) => {
console.error(err);
});
}
/* eslint-disable @typescript-eslint/no-var-requires */
const { Command, Option } = require("commander");
const { readFileSync, writeFileSync } = require("fs");
const commitAndTagVersion = require("standard-version");
const dedent = require("dedent");
const c = require("ansi-colors");
const program = new Command();

c.theme({
danger: c.red,
dark: c.dim.gray,
disabled: c.gray,
em: c.italic,
heading: c.bold.underline,
info: c.cyan,
muted: c.dim,
primary: c.blue,
strong: c.bold,
success: c.green.bold,
underline: c.underline,
warning: c.yellow.underline,
});

program
.description("Bump version and create a new tag")
.option("-b, --beta", "Pre-release version")
.option("--dry-run", "Dry run")
.addOption(
new Option("-r, --release-as <size>", "release type version").choices([
"major",
"minor",
"patch",
])
);

program.parse();
const opt = program.opts();

const betaMsg = opt.beta ? c.em("- Pre-release\n\t") : "";
const dryRunMsg = opt.dryRun ? c.em("- Dry run\n\t") : "";
const releaseAsMsg = opt.releaseAs
? c.em(`- Release as ${c.underline(opt.releaseAs)}`)
: "";

const msg = dedent(`
${c.heading("Options :")}
${betaMsg}${dryRunMsg}${releaseAsMsg}
`);

console.log(msg);
console.log();

if (opt.beta) {
console.log(`${c.bold.green(">")} ${c.info.underline("Bumping beta version...")}`);
console.log();
const bumpFiles = [
{
filename: "manifest-beta.json",
type: "json",
},
{
filename: "package.json",
type: "json",
},
{
filename: "package-lock.json",
type: "json",
},
];
commitAndTagVersion({
infile: "CHANGELOG-beta.md",
bumpFiles: bumpFiles,
prerelease: "",
dryRun: opt.dryRun,
tagPrefix: "",
})
.then(() => {
console.log("Done");
})
.catch((err) => {
console.error(err);
});
} else {
const versionBumped = opt.releaseAs
? c.info("Release as " + c.underline(opt.releaseAs))
: c.info("Release");
console.log(`${c.bold.green(">")} ${c.underline(versionBumped)}`);
console.log();

const bumpFiles = [
{
filename: "manifest-beta.json",
type: "json",
},
{
filename: "package.json",
type: "json",
},
{
filename: "package-lock.json",
type: "json",
},
{
filename: "manifest.json",
type: "json",
}
];


commitAndTagVersion({
infile: "CHANGELOG.md",
bumpFiles: bumpFiles,
dryRun: opt.dryRun,
tagPrefix: "",
})
.then(() => {
console.log("Done");
})
.catch((err) => {
console.error(err);
});
}
Loading

0 comments on commit bb03108

Please sign in to comment.