Skip to content

Commit 6cd64e9

Browse files
authored
Merge pull request #1657 from flevi29/remove-config-comments
Remove unneeded comments from config files
2 parents cd61a8c + 73b6196 commit 6cd64e9

File tree

4 files changed

+9
-103
lines changed

4 files changed

+9
-103
lines changed

.eslintrc.js

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,34 @@
22

33
module.exports = {
44
root: true,
5-
env: {
6-
// @TODO: Can be removed, ES versions are cumulative:
7-
// https://stackoverflow.com/a/61688878
8-
// es6: true,
9-
// This seems to be what Node.js 18, 20 fully supports, but online documentation
10-
// isn't exactly crystal clear about what should be put here
11-
es2022: true,
12-
browser: true,
13-
node: true,
14-
},
5+
env: { es2022: true, browser: true, node: true },
156
// Standard linting for pure javascript files
16-
parserOptions: {
17-
// @TODO: Can be removed, as env ES version sets this too:
18-
// https://eslint.org/docs/latest/use/configure/language-options#specifying-environments
19-
// ecmaVersion: 2019,
20-
// @TODO: Remove because in JS files we use commonjs
21-
// sourceType: 'module',
22-
},
23-
// prettier must always be put last, so it overrides anything before it
247
extends: [
258
'eslint:recommended',
26-
// Disables all style rules
9+
// Disables all style rules (must always be put last, so it overrides anything before it)
2710
// https://prettier.io/docs/en/integrating-with-linters.html
2811
// https://github.com/prettier/eslint-config-prettier
2912
'prettier',
3013
],
31-
rules: {
32-
// @TODO: Remove this rule, as it's a style rule covered by prettier and
33-
// it's deprecated https://eslint.org/docs/latest/rules/comma-dangle
34-
// 'comma-dangle': 'off',
35-
},
3614
overrides: [
3715
// TypeScript linting for TypeScript files
3816
{
3917
files: '*.ts',
4018
plugins: [
4119
'@typescript-eslint',
42-
// TSDoc is only meant for TS files https://tsdoc.org/
20+
// https://tsdoc.org/
4321
'eslint-plugin-tsdoc',
4422
],
4523
parser: '@typescript-eslint/parser',
4624
parserOptions: { project: 'tsconfig.eslint.json' },
47-
// prettier must always be put last, so it overrides anything before it
4825
extends: [
4926
'plugin:@typescript-eslint/recommended-type-checked',
5027
'prettier',
5128
],
5229
rules: {
53-
// @TODO: Remove as it doesn't seem to cause issues anymore with fn overloads
54-
// 'no-dupe-class-members': 'off', // Off due to conflict with typescript overload functions
5530
'tsdoc/syntax': 'error',
56-
// new TS rules begin @TODO: Remove these and adapt code
31+
// @TODO: Remove the ones between "~~", adapt code
32+
// ~~
5733
'@typescript-eslint/prefer-as-const': 'off',
5834
'@typescript-eslint/ban-ts-comment': 'off',
5935
'@typescript-eslint/no-unsafe-call': 'off',
@@ -62,40 +38,17 @@ module.exports = {
6238
'@typescript-eslint/no-unsafe-assignment': 'off',
6339
'@typescript-eslint/no-unsafe-argument': 'off',
6440
'@typescript-eslint/no-floating-promises': 'off',
65-
// new TS rules end
41+
// ~~
6642
'@typescript-eslint/array-type': ['warn', { default: 'array-simple' }],
67-
// @TODO: Remove, as it's already off
68-
// '@typescript-eslint/return-await': 'off',
69-
// @TODO: Remove this rule, deprecated:
70-
// https://typescript-eslint.io/rules/space-before-function-paren/
71-
// '@typescript-eslint/space-before-function-paren': 0,
7243
// @TODO: Should be careful with this rule, should leave it be and disable
7344
// it within files where necessary with explanations
7445
'@typescript-eslint/no-explicit-any': 'off',
75-
// @TODO: Remove, as it's already off
76-
// '@typescript-eslint/explicit-function-return-type': 'off',
77-
// @TODO: Remove, as it's already off
78-
// '@typescript-eslint/no-throw-literal': 'off',
7946
'@typescript-eslint/no-unused-vars': [
8047
'error',
8148
// argsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#argsignorepattern
8249
// varsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#varsignorepattern
8350
{ args: 'all', argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
8451
],
85-
// @TODO: Remove this rule, as it's a style rule covered by prettier
86-
// '@typescript-eslint/member-delimiter-style': [
87-
// 'error',
88-
// {
89-
// multiline: {
90-
// delimiter: 'none', // 'none' or 'semi' or 'comma'
91-
// requireLast: true,
92-
// },
93-
// singleline: {
94-
// delimiter: 'semi', // 'semi' or 'comma'
95-
// requireLast: false,
96-
// },
97-
// },
98-
// ],
9952
// @TODO: Not recommended to disable rule, should instead disable locally
10053
// with explanation
10154
'@typescript-eslint/ban-ts-ignore': 'off',
@@ -112,9 +65,8 @@ module.exports = {
11265
jest: true,
11366
'jest/globals': true,
11467
},
115-
// prettier must always be put last, so it overrides anything before it
11668
extends: ['plugin:jest/recommended', 'prettier'],
117-
// @TODO: Remove these rules and adapt code!
69+
// @TODO: Remove all of these rules and adapt code!
11870
rules: {
11971
'jest/no-disabled-tests': 'off',
12072
'jest/expect-expect': 'off',

.prettierrc.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22

33
module.exports = {
44
singleQuote: true,
5-
// @TODO Remove as it's default
6-
// arrowParens: 'always',
75
semi: false,
8-
// @TODO Remove as it's default
9-
// bracketSpacing: true,
106
trailingComma: 'es5',
11-
// @TODO Remove as it's default
12-
// printWidth: 80,
137
plugins: ['./node_modules/prettier-plugin-jsdoc/dist/index.js'],
148
// https://github.com/hosseinmd/prettier-plugin-jsdoc#tsdoc
159
tsdoc: true,

tsconfig.eslint.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
22
// extend your base config so you don't have to redefine your compilerOptions
33
"extends": "./tsconfig.json",
4-
// @TODO: Can be removed, all of these are already in the extended tsconfig.json
5-
// "compilerOptions": {
6-
// "allowJs": false,
7-
// "module": "esnext"
8-
// },
94
"include": [
105
"src/**/*.ts",
116
"tests/**/*.ts",

tsconfig.json

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
{
22
"compilerOptions": {
3-
// @TODO: Remove these, as we're not using decorators
4-
// "experimentalDecorators": true,
5-
// "emitDecoratorMetadata": true,
6-
// @TODO: Remove, as it defaults to true: https://www.typescriptlang.org/tsconfig#forceConsistentCasingInFileNames
7-
// "forceConsistentCasingInFileNames": true,
8-
// @TODO: Remove, as it's false by default: https://www.typescriptlang.org/tsconfig#removeComments
9-
// "removeComments": false,
10-
// @TODO: This is false by default, can be removed
11-
// "allowJs": false,
123
// @TODO: perhaps "emitDeclarationOnly" should be used here (build fails with it), need to
134
// investigate further https://www.typescriptlang.org/tsconfig#emitDeclarationOnly
145
// probably need to update rollup and its config
@@ -21,42 +12,16 @@
2112
// https://www.typescriptlang.org/docs/handbook/modules/reference.html#bundler
2213
// However "module": "node16" or "nodenext" is a better option:
2314
// https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution-for-libraries
24-
// Problem is, a lot of files would need changes, so to keep things simpler for now let's keep it as "bundler"
2515
// Also this should be applied too: https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax
26-
// but again, too many changes for now
2716
"moduleResolution": "bundler",
2817
// "moduleResolution" = "bundler" requires this to be "esnext"
2918
"module": "esnext",
30-
// @TODO: Remove as it's not all that useful these days, and just generates more unnecessary code
31-
// just so we can `import crypto from "crypto"` instead of `import * as crypto from "crypto"`
32-
// or even better `import { createHmac } from "crypto"`
33-
// "esModuleInterop": true,
34-
// @TODO: Remove, as "moduleResolution": "bundler" sets this to true
35-
// "allowSyntheticDefaultImports": true,
3619
// Node.js 18 supports up to ES2022 according to https://www.npmjs.com/package/@tsconfig/node18
3720
// This matters for the generated CJS and ESM file, UMD file is down-leveled further to support IE11
38-
// with the help of Babel.
21+
// (only the syntax, URL, URLSearchParams, fetch is not IE11 compatible) with the help of Babel.
3922
"target": "es2022",
40-
"lib": [
41-
// @TODO: Remove as ES versions are cumulative, so ESNext contains everything
42-
//"ES2019",
43-
"ESNext",
44-
"dom"
45-
],
23+
"lib": ["ESNext", "dom"],
4624
"strict": true,
47-
// @TODO: Remove these, as they are covered by "strict":
48-
// https://www.typescriptlang.org/tsconfig#strict
49-
// "alwaysStrict": true,
50-
// "strictNullChecks": true,
51-
// "strictFunctionTypes": true,
52-
// "strictPropertyInitialization": true,
53-
// "strictBindCallApply": true,
54-
// "noImplicitAny": true,
55-
// "noImplicitThis": true,
5625
"noImplicitReturns": true
57-
// @TODO: These are already covered by ESLint, furthermore these disallow
58-
// underscore vars (_myVar) too, so they nullify the ESLint custom rule
59-
// "noUnusedLocals": true,
60-
// "noUnusedParameters": true
6126
}
6227
}

0 commit comments

Comments
 (0)