Skip to content

Commit

Permalink
chore: consolidate eslint rules (#3368)
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech authored Jul 15, 2024
1 parent 62b941d commit 9b02e47
Show file tree
Hide file tree
Showing 40 changed files with 1,494 additions and 1,148 deletions.
4 changes: 2 additions & 2 deletions api/dingus.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export default function dingus(req, res) {
return res.status(405).json({
error: {
code: 'method_not_allowed',
message: 'Only GET requests are supported for this endpoint.'
}
message: 'Only GET requests are supported for this endpoint.',
},
});
}
const { text = '' } = req.query;
Expand Down
6 changes: 3 additions & 3 deletions bin/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function main(nodeProcess) {
const options = {
cwd: nodeProcess.cwd(),
env: nodeProcess.env,
stdio: 'inherit'
stdio: 'inherit',
};

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down Expand Up @@ -127,7 +127,7 @@ export async function main(nodeProcess) {
default:
if (arg.indexOf('--') === 0) {
opt = camelize(arg.replace(/^--(no-)?/, ''));
if (!marked.defaults.hasOwnProperty(opt)) {
if (!(opt in marked.defaults)) {
continue;
}
if (arg.indexOf('--no-') === 0) {
Expand Down Expand Up @@ -204,7 +204,7 @@ export async function main(nodeProcess) {
const defaultConfig = [
'~/.marked.json',
'~/.marked.js',
'~/.marked/index.js'
'~/.marked/index.js',
];

for (const configFile of defaultConfig) {
Expand Down
2 changes: 1 addition & 1 deletion docs/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function init() {
const ignoredFiles = [
join(cwd, 'docs', 'build.js'),
join(cwd, 'docs', '.eslintrc.json'),
join(cwd, 'docs', '_document.html')
join(cwd, 'docs', '_document.html'),
];

async function build(currentDir, tmpl) {
Expand Down
10 changes: 5 additions & 5 deletions docs/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let $activeOutputElem = null;
let latestVersion = 'master';
const search = searchToObject();
const markedVersions = {
master: '../'
master: '../',
};
let delayTime = 1;
let checkChangeTimeout = null;
Expand Down Expand Up @@ -55,7 +55,7 @@ Promise.all([
setInitialOutputType(),
setInitialText(),
setInitialVersion()
.then(setInitialOptions)
.then(setInitialOptions),
]).then(() => {
handleInputChange();
handleOutputChange();
Expand Down Expand Up @@ -177,7 +177,7 @@ function handleChange(panes, visiblePane) {
function setDefaultOptions() {
return messageWorker({
task: 'defaults',
version: markedVersions[$markedVerElem.value]
version: markedVersions[$markedVerElem.value],
});
}

Expand Down Expand Up @@ -282,7 +282,7 @@ function checkForChanges() {
task: 'parse',
version,
markdown,
options
options,
});
}
}
Expand All @@ -305,7 +305,7 @@ function setResponseTime(ms) {
$responseTimeElem.textContent = amount + suffix;
$responseTimeElem.animate([
{ transform: 'scale(1.2)' },
{ transform: 'scale(1)' }
{ transform: 'scale(1)' },
], 200);
}

Expand Down
6 changes: 3 additions & 3 deletions docs/demo/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function mergeOptions(options) {
'walkTokens',
'extensions',
'highlight',
'sanitizer'
'sanitizer',
];
for (const prop in defaults) {
opts[prop] = invalidOptions.includes(prop) || !(prop in options)
Expand All @@ -56,7 +56,7 @@ function parse(e) {
postMessage({
id: e.data.id,
task: e.data.task,
defaults: getDefaults()
defaults: getDefaults(),
});
break;
}
Expand All @@ -74,7 +74,7 @@ function parse(e) {
task: e.data.task,
lexed: lexedList,
parsed,
time: endTime - startTime
time: endTime - startTime,
});
break;
}
Expand Down
256 changes: 0 additions & 256 deletions eslint-config-standard.js

This file was deleted.

Loading

0 comments on commit 9b02e47

Please sign in to comment.