Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint Config Migration: Use tsconfig's resolveJsonModule, replace require with import #1053

Closed
wants to merge 3 commits into from

Conversation

filmaj
Copy link
Contributor

@filmaj filmaj commented Aug 9, 2021

Summary

This is a PR that should be merged into #1024 and incrementally addresses #842.

This PR sets resolveJsonModules to true in the tsconfig.json, allowing for use of import on .json files, and thus fixing the lint failures around use of require.

Impact

Before

✖ 362 problems (173 errors, 189 warnings)
  76 errors and 0 warnings potentially fixable with the `--fix` option.

After

✖ 360 problems (171 errors, 189 warnings)
  76 errors and 0 warnings potentially fixable with the `--fix` option.

Requirements (place an x in each [ ])

@filmaj filmaj added the tests M-T: Testing work only label Aug 9, 2021
@filmaj filmaj self-assigned this Aug 9, 2021
@filmaj filmaj force-pushed the resolve-json-module branch from e44786c to c92a332 Compare August 10, 2021 00:37
Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Contributor

@misscoded misscoded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, love this change!

Copy link
Member

@stevengill stevengill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think this breaks the distribution. I made this change last year, when it comes time to release, the tar file generated is broken because pakage.json lives outside of src. So previously, when generating the tar for release (npm pack), src is the root directory. With this change, the root changes to package.json and src becomes a sibling of that.

@seratch
Copy link
Member

seratch commented Aug 18, 2021

@stevengill Great point! I've confirmed that npm pack does not generate a valid package with this change.

" tar.vim version v32
" Browsing tarfile /Users/ksera/github/bolt-js/slack-bolt-3.5.0.tgz
" Select a file with cursor and press ENTER

package/LICENSE
package/dist/package.json
package/package.json
package/CHANGELOG.md
package/README.md

@filmaj filmaj force-pushed the resolve-json-module branch from c92a332 to 6b2203e Compare August 23, 2021 17:14
@filmaj
Copy link
Contributor Author

filmaj commented Aug 23, 2021

@stevengill understood, but I wonder if that is a separate packaging/distribution problem? Indeed, should we adopt this particular PR, the releasing process would need to be updated, but perhaps these are two separate problems that should be examined independently?

Assuming I understand correctly, could we solve the issue by updating / automating the release process with a script that moves any files around as needed? Related: can anyone share details around how packaging/releasing/distribution is done? The maintainer's guide is a bit light on the specific steps.

When I run npm pack, I see the file list assembled is:

➜ npm pack

> @slack/[email protected] prepare /Users/fmaj/src/bolt-js
> npm run build


> @slack/[email protected] build /Users/fmaj/src/bolt-js
> tsc

npm notice
npm notice 📦  @slack/[email protected]
npm notice === Tarball Contents ===
npm notice 1.1kB LICENSE
npm notice 2.7kB dist/package.json
npm notice 2.4kB package.json
npm notice 258B  CHANGELOG.md
npm notice 8.4kB README.md
npm notice === Tarball Details ===
npm notice name:          @slack/bolt
npm notice version:       3.5.0
npm notice filename:      slack-bolt-3.5.0.tgz
npm notice package size:  5.6 kB
npm notice unpacked size: 14.9 kB
npm notice shasum:        f964ea2107b54e2bd56e999807839160b49fff1b
npm notice integrity:     sha512-1p99F6sfJTHlS[...]HN9r4phAmDqiQ==
npm notice total files:   5
npm notice
slack-bolt-3.5.0.tgz

5 files, no code! 🙈 so, I am clearly doing something wrong!

@filmaj filmaj force-pushed the resolve-json-module branch from 6b2203e to e03441f Compare August 23, 2021 17:56
@filmaj
Copy link
Contributor Author

filmaj commented Aug 23, 2021

I think I see the problem... the project structure seems to be confounding changes between different PRs, causing the structure of the final package to be muddled.

I have added a new commit that ensures a build:clean is run before every build. Now, when I run npm pack, it looks like source files are properly included:

npm notice === Tarball Details ===
npm notice name:          @slack/bolt
npm notice version:       3.5.0
npm notice filename:      slack-bolt-3.5.0.tgz
npm notice package size:  82.1 kB
npm notice unpacked size: 384.1 kB
npm notice shasum:        6890c28772aff4dbda6f3ee455b297af1471af3b
npm notice integrity:     sha512-N2NnmuHJ40NUP[...]YoiTHbxxGHQhg==
npm notice total files:   136
npm notice
slack-bolt-3.5.0.tgz

The directory structure now looks a bit better, with only a single package.json in the root:

➜ tar tvf slack-bolt-3.5.0.tgz
-rw-r--r--  0 0      0        1132 Oct 26  1985 package/LICENSE
-rw-r--r--  0 0      0       35608 Oct 26  1985 package/dist/App.js
-rw-r--r--  0 0      0        8037 Oct 26  1985 package/dist/receivers/AwsLambdaReceiver.js
-rw-r--r--  0 0      0         292 Oct 26  1985 package/dist/types/events/base-events.js
-rw-r--r--  0 0      0         117 Oct 26  1985 package/dist/types/actions/block-action.js
-rw-r--r--  0 0      0       12330 Oct 26  1985 package/dist/middleware/builtin.js
-rw-r--r--  0 0      0        3000 Oct 26  1985 package/dist/conversation-store.js
-rw-r--r--  0 0      0         118 Oct 26  1985 package/dist/types/actions/dialog-action.js
-rw-r--r--  0 0      0        4446 Oct 26  1985 package/dist/errors.js
-rw-r--r--  0 0      0       15690 Oct 26  1985 package/dist/receivers/ExpressReceiver.js
-rw-r--r--  0 0      0         120 Oct 26  1985 package/dist/types/shortcuts/global-shortcut.js
-rw-r--r--  0 0      0        4141 Oct 26  1985 package/dist/helpers.js
-rw-r--r--  0 0      0         112 Oct 26  1985 package/dist/types/helpers.js
-rw-r--r--  0 0      0       17156 Oct 26  1985 package/dist/receivers/HTTPReceiver.js
-rw-r--r--  0 0      0        3305 Oct 26  1985 package/dist/index.js
-rw-r--r--  0 0      0         836 Oct 26  1985 package/dist/types/actions/index.js
-rw-r--r--  0 0      0         110 Oct 26  1985 package/dist/types/command/index.js
-rw-r--r--  0 0      0         671 Oct 26  1985 package/dist/types/events/index.js
-rw-r--r--  0 0      0        1031 Oct 26  1985 package/dist/types/index.js
-rw-r--r--  0 0      0         110 Oct 26  1985 package/dist/types/options/index.js
-rw-r--r--  0 0      0         766 Oct 26  1985 package/dist/types/shortcuts/index.js
-rw-r--r--  0 0      0         110 Oct 26  1985 package/dist/types/view/index.js
-rw-r--r--  0 0      0         124 Oct 26  1985 package/dist/types/actions/interactive-message.js
-rw-r--r--  0 0      0         119 Oct 26  1985 package/dist/types/events/message-events.js
-rw-r--r--  0 0      0         121 Oct 26  1985 package/dist/types/shortcuts/message-shortcut.js
-rw-r--r--  0 0      0         115 Oct 26  1985 package/dist/types/middleware.js
-rw-r--r--  0 0      0         955 Oct 26  1985 package/dist/middleware/process.js
-rw-r--r--  0 0      0         113 Oct 26  1985 package/dist/types/receiver.js
-rw-r--r--  0 0      0         652 Oct 26  1985 package/dist/receivers/render-html-for-install-path.js
-rw-r--r--  0 0      0        4976 Oct 26  1985 package/dist/receivers/SocketModeReceiver.js
-rw-r--r--  0 0      0         114 Oct 26  1985 package/dist/types/utilities.js
-rw-r--r--  0 0      0        4723 Oct 26  1985 package/dist/receivers/verify-request.js
-rw-r--r--  0 0      0         123 Oct 26  1985 package/dist/types/actions/workflow-step-edit.js
-rw-r--r--  0 0      0        7203 Oct 26  1985 package/dist/WorkflowStep.js
-rw-r--r--  0 0      0        2434 Oct 26  1985 package/package.json
-rw-r--r--  0 0      0        6646 Oct 26  1985 package/dist/App.d.ts.map
-rw-r--r--  0 0      0       22227 Oct 26  1985 package/dist/App.js.map
-rw-r--r--  0 0      0        1771 Oct 26  1985 package/dist/receivers/AwsLambdaReceiver.d.ts.map
-rw-r--r--  0 0      0        5573 Oct 26  1985 package/dist/receivers/AwsLambdaReceiver.js.map
-rw-r--r--  0 0      0       14562 Oct 26  1985 package/dist/types/events/base-events.d.ts.map
-rw-r--r--  0 0      0         161 Oct 26  1985 package/dist/types/events/base-events.js.map
-rw-r--r--  0 0      0        5307 Oct 26  1985 package/dist/types/actions/block-action.d.ts.map
-rw-r--r--  0 0      0         136 Oct 26  1985 package/dist/types/actions/block-action.js.map
-rw-r--r--  0 0      0        1612 Oct 26  1985 package/dist/middleware/builtin.d.ts.map
-rw-r--r--  0 0      0        7267 Oct 26  1985 package/dist/middleware/builtin.js.map
-rw-r--r--  0 0      0         828 Oct 26  1985 package/dist/conversation-store.d.ts.map
-rw-r--r--  0 0      0        1774 Oct 26  1985 package/dist/conversation-store.js.map
-rw-r--r--  0 0      0         963 Oct 26  1985 package/dist/types/actions/dialog-action.d.ts.map
-rw-r--r--  0 0      0         138 Oct 26  1985 package/dist/types/actions/dialog-action.js.map
-rw-r--r--  0 0      0        1725 Oct 26  1985 package/dist/errors.d.ts.map
-rw-r--r--  0 0      0        2021 Oct 26  1985 package/dist/errors.js.map
-rw-r--r--  0 0      0        2453 Oct 26  1985 package/dist/receivers/ExpressReceiver.d.ts.map
-rw-r--r--  0 0      0        9828 Oct 26  1985 package/dist/receivers/ExpressReceiver.js.map
-rw-r--r--  0 0      0         675 Oct 26  1985 package/dist/types/shortcuts/global-shortcut.d.ts.map
-rw-r--r--  0 0      0         144 Oct 26  1985 package/dist/types/shortcuts/global-shortcut.js.map
-rw-r--r--  0 0      0         435 Oct 26  1985 package/dist/helpers.d.ts.map
-rw-r--r--  0 0      0         600 Oct 26  1985 package/dist/types/helpers.d.ts.map
-rw-r--r--  0 0      0        2422 Oct 26  1985 package/dist/helpers.js.map
-rw-r--r--  0 0      0         115 Oct 26  1985 package/dist/types/helpers.js.map
-rw-r--r--  0 0      0        2356 Oct 26  1985 package/dist/receivers/HTTPReceiver.d.ts.map
-rw-r--r--  0 0      0       10014 Oct 26  1985 package/dist/receivers/HTTPReceiver.js.map
-rw-r--r--  0 0      0         857 Oct 26  1985 package/dist/index.d.ts.map
-rw-r--r--  0 0      0        1189 Oct 26  1985 package/dist/types/actions/index.d.ts.map
-rw-r--r--  0 0      0         942 Oct 26  1985 package/dist/types/command/index.d.ts.map
-rw-r--r--  0 0      0        1785 Oct 26  1985 package/dist/types/events/index.d.ts.map
-rw-r--r--  0 0      0         300 Oct 26  1985 package/dist/types/index.d.ts.map
-rw-r--r--  0 0      0        4938 Oct 26  1985 package/dist/types/options/index.d.ts.map
-rw-r--r--  0 0      0         642 Oct 26  1985 package/dist/types/shortcuts/index.d.ts.map
-rw-r--r--  0 0      0        3945 Oct 26  1985 package/dist/types/view/index.d.ts.map
-rw-r--r--  0 0      0         614 Oct 26  1985 package/dist/index.js.map
-rw-r--r--  0 0      0         184 Oct 26  1985 package/dist/types/actions/index.js.map
-rw-r--r--  0 0      0         122 Oct 26  1985 package/dist/types/command/index.js.map
-rw-r--r--  0 0      0         144 Oct 26  1985 package/dist/types/events/index.js.map
-rw-r--r--  0 0      0         238 Oct 26  1985 package/dist/types/index.js.map
-rw-r--r--  0 0      0         122 Oct 26  1985 package/dist/types/options/index.js.map
-rw-r--r--  0 0      0         173 Oct 26  1985 package/dist/types/shortcuts/index.js.map
-rw-r--r--  0 0      0         119 Oct 26  1985 package/dist/types/view/index.js.map
-rw-r--r--  0 0      0        1435 Oct 26  1985 package/dist/types/actions/interactive-message.d.ts.map
-rw-r--r--  0 0      0         150 Oct 26  1985 package/dist/types/actions/interactive-message.js.map
-rw-r--r--  0 0      0        8460 Oct 26  1985 package/dist/types/events/message-events.d.ts.map
-rw-r--r--  0 0      0         139 Oct 26  1985 package/dist/types/events/message-events.js.map
-rw-r--r--  0 0      0        1018 Oct 26  1985 package/dist/types/shortcuts/message-shortcut.d.ts.map
-rw-r--r--  0 0      0         146 Oct 26  1985 package/dist/types/shortcuts/message-shortcut.js.map
-rw-r--r--  0 0      0        1201 Oct 26  1985 package/dist/types/middleware.d.ts.map
-rw-r--r--  0 0      0         121 Oct 26  1985 package/dist/types/middleware.js.map
-rw-r--r--  0 0      0         488 Oct 26  1985 package/dist/middleware/process.d.ts.map
-rw-r--r--  0 0      0         721 Oct 26  1985 package/dist/middleware/process.js.map
-rw-r--r--  0 0      0         538 Oct 26  1985 package/dist/types/receiver.d.ts.map
-rw-r--r--  0 0      0         117 Oct 26  1985 package/dist/types/receiver.js.map
-rw-r--r--  0 0      0         230 Oct 26  1985 package/dist/receivers/render-html-for-install-path.d.ts.map
-rw-r--r--  0 0      0         255 Oct 26  1985 package/dist/receivers/render-html-for-install-path.js.map
-rw-r--r--  0 0      0        1655 Oct 26  1985 package/dist/receivers/SocketModeReceiver.d.ts.map
-rw-r--r--  0 0      0        3374 Oct 26  1985 package/dist/receivers/SocketModeReceiver.js.map
-rw-r--r--  0 0      0        1031 Oct 26  1985 package/dist/types/utilities.d.ts.map
-rw-r--r--  0 0      0         119 Oct 26  1985 package/dist/types/utilities.js.map
-rw-r--r--  0 0      0         584 Oct 26  1985 package/dist/receivers/verify-request.d.ts.map
-rw-r--r--  0 0      0        2231 Oct 26  1985 package/dist/receivers/verify-request.js.map
-rw-r--r--  0 0      0        1103 Oct 26  1985 package/dist/types/actions/workflow-step-edit.d.ts.map
-rw-r--r--  0 0      0         148 Oct 26  1985 package/dist/types/actions/workflow-step-edit.js.map
-rw-r--r--  0 0      0        3102 Oct 26  1985 package/dist/WorkflowStep.d.ts.map
-rw-r--r--  0 0      0        5527 Oct 26  1985 package/dist/WorkflowStep.js.map
-rw-r--r--  0 0      0         258 Oct 26  1985 package/CHANGELOG.md
-rw-r--r--  0 0      0        8395 Oct 26  1985 package/README.md
-rw-r--r--  0 0      0        7911 Oct 26  1985 package/dist/App.d.ts
-rw-r--r--  0 0      0        1610 Oct 26  1985 package/dist/receivers/AwsLambdaReceiver.d.ts
-rw-r--r--  0 0      0       16348 Oct 26  1985 package/dist/types/events/base-events.d.ts
-rw-r--r--  0 0      0        7363 Oct 26  1985 package/dist/types/actions/block-action.d.ts
-rw-r--r--  0 0      0        2405 Oct 26  1985 package/dist/middleware/builtin.d.ts
-rw-r--r--  0 0      0        1553 Oct 26  1985 package/dist/conversation-store.d.ts
-rw-r--r--  0 0      0        1096 Oct 26  1985 package/dist/types/actions/dialog-action.d.ts
-rw-r--r--  0 0      0        2976 Oct 26  1985 package/dist/errors.d.ts
-rw-r--r--  0 0      0        2800 Oct 26  1985 package/dist/receivers/ExpressReceiver.d.ts
-rw-r--r--  0 0      0         686 Oct 26  1985 package/dist/types/shortcuts/global-shortcut.d.ts
-rw-r--r--  0 0      0         803 Oct 26  1985 package/dist/helpers.d.ts
-rw-r--r--  0 0      0         608 Oct 26  1985 package/dist/types/helpers.d.ts
-rw-r--r--  0 0      0        2555 Oct 26  1985 package/dist/receivers/HTTPReceiver.d.ts
-rw-r--r--  0 0      0        1104 Oct 26  1985 package/dist/index.d.ts
-rw-r--r--  0 0      0        2732 Oct 26  1985 package/dist/types/actions/index.d.ts
-rw-r--r--  0 0      0        1013 Oct 26  1985 package/dist/types/command/index.d.ts
-rw-r--r--  0 0      0        2443 Oct 26  1985 package/dist/types/events/index.d.ts
-rw-r--r--  0 0      0         282 Oct 26  1985 package/dist/types/index.d.ts
-rw-r--r--  0 0      0        5737 Oct 26  1985 package/dist/types/options/index.d.ts
-rw-r--r--  0 0      0         811 Oct 26  1985 package/dist/types/shortcuts/index.d.ts
-rw-r--r--  0 0      0        5009 Oct 26  1985 package/dist/types/view/index.d.ts
-rw-r--r--  0 0      0        1774 Oct 26  1985 package/dist/types/actions/interactive-message.d.ts
-rw-r--r--  0 0      0        7843 Oct 26  1985 package/dist/types/events/message-events.d.ts
-rw-r--r--  0 0      0         971 Oct 26  1985 package/dist/types/shortcuts/message-shortcut.d.ts
-rw-r--r--  0 0      0        2111 Oct 26  1985 package/dist/types/middleware.d.ts
-rw-r--r--  0 0      0         403 Oct 26  1985 package/dist/middleware/process.d.ts
-rw-r--r--  0 0      0         366 Oct 26  1985 package/dist/types/receiver.d.ts
-rw-r--r--  0 0      0         139 Oct 26  1985 package/dist/receivers/render-html-for-install-path.d.ts
-rw-r--r--  0 0      0        1773 Oct 26  1985 package/dist/receivers/SocketModeReceiver.d.ts
-rw-r--r--  0 0      0        1190 Oct 26  1985 package/dist/types/utilities.d.ts
-rw-r--r--  0 0      0        2337 Oct 26  1985 package/dist/receivers/verify-request.d.ts
-rw-r--r--  0 0      0        1127 Oct 26  1985 package/dist/types/actions/workflow-step-edit.d.ts
-rw-r--r--  0 0      0        4601 Oct 26  1985 package/dist/WorkflowStep.d.ts

I can also extract the tar file, cd package && node and run require('.') to successfully pull in the library.

WDYT @stevengill @seratch ?

@filmaj filmaj requested review from stevengill and seratch August 23, 2021 18:03
@filmaj filmaj force-pushed the resolve-json-module branch from e03441f to c3f46b1 Compare August 23, 2021 20:01
@seratch
Copy link
Member

seratch commented Aug 24, 2021

@filmaj npm pack with the latest tsconfig.json changes still does not generate a valid package for me. It still adds dist/src/* when running the build command. I looked into some other tsconfig properties but I'm still unsure how I can adjust the build process 🤔

@filmaj
Copy link
Contributor Author

filmaj commented Aug 24, 2021

It sounds like using resolveJsonModule changes the outputted structure because of the import of package.json, effectively changing what the rootDir value is (see this StackOverflow post for some details). Currently, rootDir is commented out in tsconfig.json, so previous to this PR the root dir was implied to be ./src/. With the import of package.json, the rootDir is implicitly ./ now, which results in the changed directory structure. tsc also copies package.json into dist/ because of the use of resolveJsonModule 😞

I have so far tried two different approaches:

  • handling this complexity in the build scripts, that is, keeping this dist/src structure and updating the main, files and includes fields of package.json to reflect this change in folder structure. Packaging works fine with a slight change (need to run npm publish dist/ instead of just npm publish) - but running the "types tests" fails because of tsd's reliance on these fields from package.json.
  • using TypeScript's Project References to treat the root directory containing the package.json file as well as the src dir as separate TypeScript projects, each with their own tsconfig.json file. With this approach, packaging works as it did before - but again I am having trouble with getting the types tests executing.

I will continue to investigate and see what further options exist / can be used.

…Project References to link them all up. Provide a dummy package.json and d.ts file for the types-tests to get them running. Be more specific about which files to include in packaging so as to avoid including the tsconfig.tsbuildinfo file.
@filmaj
Copy link
Contributor Author

filmaj commented Aug 24, 2021

OK! Well, I have some kind of solution, though I think it is hardly "nice".

The core of the solution relies on Typescript Project References. This effectively splits up bolt-js into "subprojects" from TypeScript's perspective. As such, there is not one, but now three! tsconfig.json files:

  • src/tsconfig.json: This is essentially a copy of the old tsconfig.json that was in the root of the folder. The new change here is the introduction of the references property, which references the TS project located in the root of bolt-js.
  • tsconfig.json: The tsconfig.json in the root of the project has a sole purpose: to emit the root package.json into the final package we publish to npm. This is the main "trick" in allowing for source files under src/ to import 'package.json'.
  • types-tests/tsconfig.json: This is a very permissive tsconfig.json that sets this subproject's root to be its parent directory. This allows for pulling in .ts files that exist under src/ from the types-tests/ directory.

In order to get the tsd types-tests passing, because of the inability to configure which tsconfig.json and package.json tsd will look at to figure out what it should import and test, and it's strict requirement on having a index.d.ts file as an entry point, I ended up creating a dummy package.json and dummy.d.ts file under types-tests/ (as per tsdjs/tsd#32 (comment)). Truly a 🤡 🎪 , but I didn't know how to work around this otherwise.

I can likely severely cut down on the number of lines making up tsconfig.json and types-tests/tsconfig.json, to remove the comments and include only the options needed to get the tests and packaging running as desired. The comments in src/tsconfig.json can remain as they may be helpful for tweaking this file in the future. Let me know if you all have a preference for this.

So, given all the above, what do people think? Is the amount of configuration, dummy files, etc. worth it? The other option is to leave the old way of importing package.json as-is: using require. IIRC it was only done in two spots.

Personally, having put half a day into trying to get import 'package.json' working, and this configuration mess being the best I could end up with, I think I lean towards simply keeping the two old // eslint-disable-next-line require-import comments over this configuration cluster, but I defer to what the team's opinions are on this.

@@ -18,20 +18,22 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist/**/*"
"dist/**/*.map",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is to avoid including tsconfig.tsbuildinfo, which is a new "cache" file tsc uses when you use Project References and the tsc --build command.

],
"engines": {
"node": ">=12.13.0",
"npm": ">=6.12.0"
},
"scripts": {
"prepare": "npm run build",
"build": "tsc",
"build": "npm run build:clean && tsc --build src",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More information on tsc --build available in the Project References TypeScript documentation.

@@ -81,8 +83,5 @@
"ts-node": "^8.1.0",
"tsd": "^0.13.1",
"typescript": "^4.1.0"
},
"tsd": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this section in favour of explicitly specifying the directory to run tsd in via the scripts' test:types run script section above. IMO it is a bit clearer - as a new user of tsd myself, I did not know that tsd would look for a tsd section in package.json to look for invocation options.

@filmaj filmaj requested a review from misscoded August 24, 2021 18:46
@seratch
Copy link
Member

seratch commented Aug 24, 2021

@filmaj Thanks for jumping into the deep world of the tsconfig 😺

So, given all the above, what do people think? Is the amount of configuration, dummy files, etc. worth it?

I don't think that it's worth it.

The other option is to leave the old way of importing package.json as-is: using require. IIRC it was only done in two spots.

Yes, your understanding here is correct. As the require appears only in two lines in this project so far. I think that it's totally fine to have the lint disabling comment this time.

@filmaj
Copy link
Contributor Author

filmaj commented Aug 25, 2021

Closing this pull request in favour of keeping the ol' require approach when pulling in package.json. Definitely not worth all this scaffolding to avoid two linter errors. Perhaps this PR could be used as prior work if we ever decide to come back to tackling the use of import for json files.

@filmaj filmaj closed this Aug 25, 2021
@filmaj filmaj deleted the resolve-json-module branch August 25, 2021 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests M-T: Testing work only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants