Skip to content

Commit 7c6b24d

Browse files
committed
chore: tag todo comments with additional info
Make them full sentences. Indent wrapped lines. List the person blamed for adding it. Update some dates.
1 parent 5bcbdd1 commit 7c6b24d

16 files changed

+46
-46
lines changed

.eslintrc.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// TODO [eslint@>9.5]: Use `.ts` extension to get more type checking for this file.
2-
// TODO [engine:node@>=18]: Upgrade `tseslint`.
3-
// TODO [engine:node@>=18]: Use `eslint-define-config` to get type checking for this file.
4-
// TODO [engine:node@>=18]: Use `eslint-plugin-jsdoc` to get JSDoc linting.
1+
// TODO(@lishaduck) [eslint@>9.5]: Use `.ts` extension to get more type checking for this file.
2+
// TODO(@lishaduck) [engine:node@>=18]: Upgrade `tseslint`.
3+
// TODO(@lishaduck) [engine:node@>=18]: Use `eslint-define-config` to get type checking for this file.
4+
// TODO(@lishaduck) [engine:node@>=18]: Use `eslint-plugin-jsdoc` to get JSDoc linting.
55

66
module.exports = {
77
root: true,
@@ -67,7 +67,7 @@ module.exports = {
6767
'@typescript-eslint/switch-exhaustiveness-check': 'error',
6868
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
6969
'default-case': 'off',
70-
'n/shebang': 'off', // TODO [eslint-plugin-n@>=17]: Turn on 'n/hashbang'. For now, `shebang` is buggy.
70+
'n/shebang': 'off', // TODO(@lishaduck) [eslint-plugin-n@>=17]: Turn on 'n/hashbang'. For now, `shebang` is buggy.
7171
'@eslint-community/eslint-comments/require-description': 'error',
7272
strict: ['error', 'global'],
7373
'unicorn/import-style': [
@@ -84,35 +84,35 @@ module.exports = {
8484
'unicorn/prevent-abbreviations': 'off',
8585
'no-fallthrough': 'off', // TS checks for this, and TSESLint doesn't provide an alternative.
8686

87-
// TODO: Once there are no more `any`s, start enforcing these rules.
87+
// TODO(@lishaduck): Once there are no more `any`s, start enforcing these rules.
8888
'@typescript-eslint/no-unsafe-assignment': 'off',
8989
'@typescript-eslint/no-unsafe-argument': 'off',
9090
'@typescript-eslint/no-unsafe-member-access': 'off',
9191
'@typescript-eslint/no-unsafe-call': 'off',
9292
'@typescript-eslint/no-unsafe-return': 'off',
9393

94-
// TODO: Enable stricter promise rules.
94+
// TODO(@lishaduck): Enable stricter promise rules.
9595
'@typescript-eslint/no-misused-promises': 'off',
9696
'@typescript-eslint/no-floating-promises': 'off',
9797
'promise/catch-or-return': 'off',
9898
'promise/always-return': 'off',
9999

100-
// TODO: Security issues that should eventually get fixed.
100+
// TODO(@lishaduck): Security issues that should eventually get fixed.
101101
'security/detect-object-injection': 'off',
102102
'security/detect-non-literal-fs-filename': 'off',
103103
'security/detect-non-literal-require': 'off',
104-
'security/detect-unsafe-regex': 'off', // TODO: Add `eslint-plugin-regexp` and fix these issues.
104+
'security/detect-unsafe-regex': 'off', // TODO(@lishaduck): Add `eslint-plugin-regexp` and fix these issues.
105105

106-
// TODO: Enable rules that require newer versions of Node.js when we bump the minimum version.
107-
'unicorn/prefer-string-replace-all': 'off', // TODO [engine:node@>=15]: Enable this rule.
108-
'unicorn/prefer-at': 'off' // TODO [engine:node@>=16.6]: Enable this rule.
106+
// TODO(@lishaduck): Enable rules that require newer versions of Node.js when we bump the minimum version.
107+
'unicorn/prefer-string-replace-all': 'off', // TODO(@lishaduck) [engine:node@>=15]: Enable this rule.
108+
'unicorn/prefer-at': 'off' // TODO(@lishaduck) [engine:node@>=16.6]: Enable this rule.
109109
},
110110
overrides: [
111111
{
112112
files: ['./new-package/**/*.js'],
113113
rules: {
114114
'n/no-process-exit': 'off',
115-
'@typescript-eslint/unbound-method': 'off' // TODO: Fix this warning. @lishaduck just got confused.
115+
'@typescript-eslint/unbound-method': 'off' // TODO(@lishaduck): Fix this warning. I just got confused.
116116
}
117117
}
118118
],

bin/elm-review

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env node
22

3-
// TODO: With ESM, this should use TLA.
4-
3+
// TODO(@lishaduck): With ESM, this should use TLA.
54
require('../lib/main')();

lib/autofix.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function askConfirmationToFixWithOptions(options, app, elmVersion) {
106106
filesToFix.map((file) => {
107107
const filePath = path.resolve(basePath, file.path);
108108
if (filePath.endsWith('.elm')) {
109-
// TODO Make this async
109+
// TODO(@jfmengels): Make this asynchronous.
110110
return formatFileContent(options, file, filePath);
111111
}
112112

@@ -120,8 +120,8 @@ function askConfirmationToFixWithOptions(options, app, elmVersion) {
120120

121121
let dependencies;
122122
if (modifiedElmJson) {
123-
// TODO Check if source-directories have changed, and if so, load/unload the necessary files.
124-
// TODO Check if dependencies have changed before we do this
123+
// TODO(@jfmengels): Check if source-directories have changed, and if so, load/unload the necessary files.
124+
// TODO(@jfmengels): Check if dependencies have changed before we do this.
125125
dependencies = await ProjectDependencies.collect(
126126
options,
127127
JSON.parse(modifiedElmJson.source),

lib/build.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ function unique(array) {
362362
return [...new Set(array)];
363363
}
364364

365-
// TODO: TSify
365+
// TODO(@lishaduck): TSify these type definitions.
366366
/**
367367
* @typedef {object} CompileOptions
368368
* @property {string} cwd
@@ -490,7 +490,7 @@ function compilationError(options, stderr) {
490490
console.log(stderr);
491491
}
492492

493-
// TODO Handle this better
493+
// TODO(@jfmengels): Handle this better.
494494

495495
exit(1);
496496
}
@@ -579,7 +579,7 @@ async function buildElmParser(options, reviewElmJson) {
579579
),
580580
// Needed when the user has `"type": "module"` in their package.json.
581581
// Our output is CommonJS.
582-
// TODO: Switch to a .cjs file instead.
582+
// TODO(@lishaduck): Switch to a .cjs file instead.
583583
FS.mkdirp(options.generatedCodePackageJson()).then(() =>
584584
FS.writeFile(
585585
path.join(options.generatedCodePackageJson(), 'package.json'),

lib/elm-binary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ function downloadDependenciesOfElmJson(elmBinary, elmJsonPath) {
8484

8585
if (result.status !== 0) {
8686
const error = JSON.parse(result.stderr.toString());
87-
// TODO Check for other kinds of errors
87+
// TODO(@jfmengels): Check for other kinds of errors.
8888
if (error.title !== 'NO INPUT') {
89-
// TODO Print error nicely
89+
// TODO(@jfmengels): Print the error nicely.
9090
throw new Error(error);
9191
}
9292
}

lib/elm-files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async function getProjectFiles(options, elmSyntaxVersion) {
6060
({files}) => files.length === 0
6161
);
6262

63-
// TODO Have a different message depending on how directories were chosen (CLI directories, application, package)
63+
// TODO(@jfmengels): Have a different message depending on how directories were chosen (CLI directories, application, package).
6464
if (options.directoriesToAnalyze.length > 0 && emptyDirectories.length > 0) {
6565
throw new ErrorMessage.CustomError(
6666
'NO FILES FOUND',

lib/error-message.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ function formatJson(debug, error, defaultPath) {
105105
type: 'error',
106106
title: error.title,
107107
path: error.path ?? defaultPath,
108-
// TODO We currently strip the colors, but it would be nice to keep them
109-
// so that editors can have nicer error messages
108+
// TODO(@jfmengels): We currently strip the colors, but it would be nice to keep them so that editors can have nicer error messages.
110109
message: [stripAnsi(error.message.trim())],
111110
stack: debug && error.stack ? stripAnsi(error.stack) : undefined
112111
};

lib/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const fs = require('graceful-fs');
22
const path = require('node:path');
3-
// TODO [engine:node@>=16.7.0]: Use native `cp`.
3+
// TODO(@lishaduck) [engine:node@>=16.7.0]: Use native `cp`.
44
const fsExtra = require('fs-extra');
55
const chalk = require('chalk');
66
const prompts = require('prompts');

lib/module-cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const Cache = require('./cache');
55

66
function subscribe(options, app) {
77
AppState.subscribe(app.ports.cacheFile, ({source, ast}) =>
8-
// TODO Do this in a thread
8+
// TODO(@jfmengels): Do this work in a thread.
99
cacheFile(options, Hash.hash(source), ast)
1010
);
1111
}

lib/new-package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('node:path');
22
const childProcess = require('node:child_process');
33
const chalk = require('chalk');
44
const prompts = require('prompts');
5-
// TODO [engine:node@>=16.7.0]: Use native `cp`.
5+
// TODO(@lishaduck) [engine:node@>=16.7.0]: Use native `cp`.
66
const fsExtra = require('fs-extra');
77
const Init = require('./init');
88
const Spinner = require('./spinner');

lib/project-json-files.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ async function getElmJson(options, elmVersion, name, packageVersion) {
6161
}
6262
}
6363

64-
// TODO Empty this cache at some point?
65-
// Note that we might need it in watch and fix mode, but not otherwise.
64+
// TODO(@jfmengels): Empty this cache at some point?
65+
// Note that we might need it in watch and fix mode, but not otherwise.
6666
/** @type {Map<string, Promise<PackageElmJson>>} */
6767
const elmJsonInElmHomePromises = new Map();
6868

@@ -177,7 +177,7 @@ async function readFromPackagesWebsite(
177177
packageVersion,
178178
file
179179
) {
180-
// TODO [engine:node@>=18]: We can use `fetch` now.
180+
// TODO(@lishaduck) [engine:node@>=21]: We can use `fetch` now.
181181
const response = await got(
182182
`https://package.elm-lang.org/packages/${packageName}/${packageVersion}/${file}`
183183
);

lib/remote-template.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async function downloadTemplateElmJson(template, commit) {
103103
const {repoName, pathToFolder} = template;
104104
const pathToFolderAsUrl = pathToFolder ? `/${pathToFolder}` : '';
105105

106-
// TODO [engine:node@>=18]: We can use `fetch` now.
106+
// TODO(@lishaduck) [engine:node@>=21]: We can use `fetch` now.
107107
const response = await got(
108108
`https://raw.githubusercontent.com/${repoName}/${commit}${pathToFolderAsUrl}/elm.json`
109109
).catch((error) => {
@@ -270,7 +270,7 @@ async function makeGitHubApiRequest(options, url, handleNotFound) {
270270

271271
Debug.log(`Making API request to GitHub: ${url}`);
272272
try {
273-
// TODO [engine:node@>=18]: We can use `fetch` now.
273+
// TODO(@lishaduck) [engine:node@>=21]: We can use `fetch` now.
274274
const response = await got(url, parameters);
275275

276276
return response.body;

lib/result-cache-json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function replacer(_key, value) {
99
}
1010

1111
if (typeof value === 'object') {
12-
// TODO Serialize Dicts also
12+
// TODO (@jfmengels): Also support serializing `Dict`s.
1313
// if (value.$ === -1) {
1414
// return {
1515
// $: '$D',

lib/result-cache.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ let worker = null;
1818
const resultCache = new Map();
1919
const promisesToResolve = new Map();
2020

21-
// TODO Create an alternate version of Options used in elm-app-worker.
22-
// Depending on whether this is running in a worker or not, the options will be slightly different.
21+
// TODO(@jfmengels): Create an alternate version of Options used in
22+
// `elm-app-worker`. Depending on whether this is running in a worker or not,
23+
// the options will be slightly different.
2324
/**
2425
* Load cache results.
2526
*
@@ -30,7 +31,7 @@ const promisesToResolve = new Map();
3031
* @returns {Promise<void>}
3132
*/
3233
async function load(options, ignoredDirs, ignoredFiles, cacheFolder) {
33-
// TODO Make caching work for all of these
34+
// TODO(@jfmengels): Make caching work for all of these combinations.
3435
if (
3536
options.debug ||
3637
options.directoriesToAnalyze.length > 0 ||

lib/watch.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const path = require('node:path');
2-
// TODO [engine:node@>=19.1] Use `fs.watch` (or `@parcel/watcher`).
2+
// TODO(@lishaduck) [engine:node@>=19.1]: Use `fs.watch` (or `@parcel/watcher`).
33
const chokidar = require('chokidar');
44
const Debug = require('./debug');
55
const FS = require('./fs-wrapper');
@@ -94,8 +94,8 @@ function watchFiles(
9494
clearConsole();
9595
}
9696

97-
// TODO Detect what has changed and only re-load the necessary parts.
98-
// We do some of this work in `autofix.js` already.
97+
// TODO(@jfmengels): Detect what has changed and only re-load the necessary parts.
98+
// We do some of this work in `autofix.js` already.
9999
Debug.log('Your `elm.json` has changed. Restarting elm-review.');
100100
}
101101

@@ -438,16 +438,17 @@ function createExtraFilesWatcher(options, app, runReview, onError, request) {
438438
*/
439439
function createSuppressedFilesWatcher(options, app, onError) {
440440
function updateSuppressedErrors() {
441-
// TODO Write last save time for each of these in appstate, and compare with the last update time
442-
// that is given as argument to this function. If possible, don't do anything.
441+
// TODO(@jfmengels): Write last save time for each of these in appstate,
442+
// and compare with the last update time that is given as argument to
443+
// this function. If possible, don't do anything.
443444
if (suppressedErrorsTimeout) {
444445
clearTimeout(suppressedErrorsTimeout);
445446
}
446447

447448
suppressedErrorsTimeout = setTimeout(async () => {
448449
const suppressedErrors = await SuppressedErrors.read(options);
449-
// TODO Avoid doing anything if suppressed errors haven't changed
450-
// It's likely this program's fault for changing anything anyway
450+
// TODO(@jfmengels): Avoid doing anything if suppressed errors haven't
451+
// changed. It's likely this program's fault for changing anything anyway.
451452
Debug.log('Suppressed errors have been added');
452453
app.ports.updateSuppressedErrors.send(suppressedErrors);
453454
}, 20);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"check-engines": "ls-engines --mode=ideal",
4848
"elm-format": "elm-format --validate ast-codec init-templates new-package parseElm review template",
4949
"elm-tests": "(cd template/ && elm make src/Elm/Review/Main.elm --output=/dev/null && elm-test)",
50-
"eslint-check": "eslint . --report-unused-disable-directives --max-warnings=5",
50+
"eslint-check": "eslint . --report-unused-disable-directives --max-warnings=2",
5151
"eslint-fix": "npm run eslint-check -- --fix",
5252
"jest": "npx jest",
5353
"prepare": "elm-tooling install",

0 commit comments

Comments
 (0)