Skip to content

Commit

Permalink
Fix dependencies in eslint-config-modular-app (#175)
Browse files Browse the repository at this point in the history
* fix dependencies in eslint-config-modular-app

- updates them to match what eslint-config-react-app's expecting
- makes typescript a peer dependency
- ensure that the project gets initialised with typescript installed at root

fixes #42

* update snapshot test

Co-authored-by: Sunil Pai <sunil.pai@jpmorgan.com>
  • Loading branch information
threepointone and Sunil Pai authored Nov 26, 2020
1 parent 54372f6 commit 04623e9
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 42 deletions.
7 changes: 7 additions & 0 deletions .changeset/wicked-badgers-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'create-modular-react-app': minor
'eslint-config-modular-app': minor
---

Fix dependencies in eslint-config-modular-app, initialise new projects with
typescript
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@types/jest": "^25.2.3",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"@typescript-eslint/eslint-plugin": "^3.5.0",
"@typescript-eslint/parser": "^3.5.0",
"@typescript-eslint/eslint-plugin": "^4.0.0",
"@typescript-eslint/parser": "^4.0.0",
"babel-eslint": "^10.1.0",
"confusing-browser-globals": "^1.0.9",
"eslint": "^7.1.0",
Expand All @@ -39,7 +39,7 @@
"eslint-plugin-jest-dom": "^2.1.0",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-react-hooks": "^4.0.8",
"eslint-plugin-testing-library": "^3.1.3",
"eslint-plugin-testing-library": "^3.9.2",
"execa": "^4.0.3",
"husky": "^4.2.5",
"is-ci": "^2.0.0",
Expand All @@ -50,7 +50,7 @@
"react-dom": "^17.0.1",
"semver": "^7.3.2",
"ts-node": "^9.0.0",
"typescript": "~4.0.5"
"typescript": "~4.1.2"
},
"husky": {
"hooks": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ describe('create-modular-react-app', () => {
"prettier": "?",
"react": "?",
"react-dom": "?",
"typescript": "?",
},
"eslintConfig": Object {
"extends": "modular-app",
Expand Down
1 change: 1 addition & 0 deletions packages/create-modular-react-app/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export default function createModularApp(argv: {
'prettier',
'modular-scripts',
'eslint-config-modular-app',
'typescript@~4.1.2',
...preferOfflineArg,
],
{ cwd: newModularRoot },
Expand Down
12 changes: 9 additions & 3 deletions packages/eslint-config-modular-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"license": "Apache-2.0",
"main": "index.js",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^3.5.0",
"@typescript-eslint/parser": "^3.5.0",
"@typescript-eslint/eslint-plugin": "^4.0.0",
"@typescript-eslint/parser": "^4.0.0",
"babel-eslint": "^10.1.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.0",
Expand All @@ -14,6 +14,12 @@
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-react-hooks": "^4.0.8",
"typescript": "~4.0.5"
"eslint-plugin-testing-library": "^3.9.2"
},
"peerDependencies": {
"typescript": "~4.1.2"
},
"devDependencies": {
"typescript": "~4.1.2"
}
}
2 changes: 1 addition & 1 deletion packages/modular-scripts/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function startApp(appPath: string): Promise<DevServer> {
clearTimeout(startAppTimeout);

completed = true;
return resolve();
return resolve(true);
}
});

Expand Down
4 changes: 2 additions & 2 deletions packages/tree-view-for-tests/src/__tests__/tree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ test('it can serialise a folder', () => {
├─ package.json
├─ src
│ ├─ __tests__
│ │ └─ index.test.ts #1r66pzs
│ ├─ cli.ts #2e40g3
│ │ └─ index.test.ts #u6q4fo
│ ├─ cli.ts #1pgxu36
│ └─ index.ts #un0l9d
└─ template
├─ README.md #1nksyzj
Expand Down
106 changes: 74 additions & 32 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1818,11 +1818,6 @@
dependencies:
"@babel/types" "^7.3.0"

"@types/eslint-visitor-keys@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==

"@types/eslint@^7.2.4":
version "7.2.4"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.4.tgz#d12eeed7741d2491b69808576ac2d20c14f74c41"
Expand Down Expand Up @@ -2101,12 +2096,13 @@
dependencies:
"@types/node" "*"

"@typescript-eslint/eslint-plugin@^3.5.0":
version "3.10.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz#7e061338a1383f59edc204c605899f93dc2e2c8f"
integrity sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ==
"@typescript-eslint/eslint-plugin@^4.0.0":
version "4.8.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.8.2.tgz#cf9102ec800391caa574f589ffe0623cca1d9308"
integrity sha512-gQ06QLV5l1DtvYtqOyFLXD9PdcILYqlrJj2l+CGDlPtmgLUzc1GpqciJFIRvyfvgLALpnxYINFuw+n9AZhPBKQ==
dependencies:
"@typescript-eslint/experimental-utils" "3.10.1"
"@typescript-eslint/experimental-utils" "4.8.2"
"@typescript-eslint/scope-manager" "4.8.2"
debug "^4.1.1"
functional-red-black-tree "^1.0.1"
regexpp "^3.0.0"
Expand All @@ -2126,17 +2122,6 @@
semver "^7.3.2"
tsutils "^3.17.1"

"@typescript-eslint/experimental-utils@3.10.1", "@typescript-eslint/experimental-utils@^3.10.1":
version "3.10.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz#e179ffc81a80ebcae2ea04e0332f8b251345a686"
integrity sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/types" "3.10.1"
"@typescript-eslint/typescript-estree" "3.10.1"
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"

"@typescript-eslint/experimental-utils@4.7.0", "@typescript-eslint/experimental-utils@^4.0.1":
version "4.7.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.7.0.tgz#8d1058c38bec3d3bbd9c898a1c32318d80faf3c5"
Expand All @@ -2149,16 +2134,38 @@
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"

"@typescript-eslint/parser@^3.5.0":
"@typescript-eslint/experimental-utils@4.8.2":
version "4.8.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.8.2.tgz#8909a5732f19329cf5ef0c39766170476bff5e50"
integrity sha512-hpTw6o6IhBZEsQsjuw/4RWmceRyESfAiEzAEnXHKG1X7S5DXFaZ4IO1JO7CW1aQ604leQBzjZmuMI9QBCAJX8Q==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/scope-manager" "4.8.2"
"@typescript-eslint/types" "4.8.2"
"@typescript-eslint/typescript-estree" "4.8.2"
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"

"@typescript-eslint/experimental-utils@^3.10.1":
version "3.10.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.10.1.tgz#1883858e83e8b442627e1ac6f408925211155467"
integrity sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw==
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz#e179ffc81a80ebcae2ea04e0332f8b251345a686"
integrity sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw==
dependencies:
"@types/eslint-visitor-keys" "^1.0.0"
"@typescript-eslint/experimental-utils" "3.10.1"
"@types/json-schema" "^7.0.3"
"@typescript-eslint/types" "3.10.1"
"@typescript-eslint/typescript-estree" "3.10.1"
eslint-visitor-keys "^1.1.0"
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"

"@typescript-eslint/parser@^4.0.0":
version "4.8.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.8.2.tgz#78dccbe5124de2b8dea2d4c363dee9f769151ca8"
integrity sha512-u0leyJqmclYr3KcXOqd2fmx6SDGBO0MUNHHAjr0JS4Crbb3C3d8dwAdlazy133PLCcPn+aOUFiHn72wcuc5wYw==
dependencies:
"@typescript-eslint/scope-manager" "4.8.2"
"@typescript-eslint/types" "4.8.2"
"@typescript-eslint/typescript-estree" "4.8.2"
debug "^4.1.1"

"@typescript-eslint/parser@^4.5.0":
version "4.7.0"
Expand All @@ -2178,6 +2185,14 @@
"@typescript-eslint/types" "4.7.0"
"@typescript-eslint/visitor-keys" "4.7.0"

"@typescript-eslint/scope-manager@4.8.2":
version "4.8.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.8.2.tgz#a18388c63ae9c17adde519384f539392f2c4f0d9"
integrity sha512-qHQ8ODi7mMin4Sq2eh/6eu03uVzsf5TX+J43xRmiq8ujng7ViQSHNPLOHGw/Wr5dFEoxq/ubKhzClIIdQy5q3g==
dependencies:
"@typescript-eslint/types" "4.8.2"
"@typescript-eslint/visitor-keys" "4.8.2"

"@typescript-eslint/types@3.10.1":
version "3.10.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.1.tgz#1d7463fa7c32d8a23ab508a803ca2fe26e758727"
Expand All @@ -2188,6 +2203,11 @@
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.7.0.tgz#5e95ef5c740f43d942542b35811f87b62fccca69"
integrity sha512-uLszFe0wExJc+I7q0Z/+BnP7wao/kzX0hB5vJn4LIgrfrMLgnB2UXoReV19lkJQS1a1mHWGGODSxnBx6JQC3Sg==

"@typescript-eslint/types@4.8.2":
version "4.8.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.8.2.tgz#c862dd0e569d9478eb82d6aee662ea53f5661a36"
integrity sha512-z1/AVcVF8ju5ObaHe2fOpZYEQrwHyZ7PTOlmjd3EoFeX9sv7UekQhfrCmgUO7PruLNfSHrJGQvrW3Q7xQ8EoAw==

"@typescript-eslint/typescript-estree@3.10.1":
version "3.10.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz#fd0061cc38add4fad45136d654408569f365b853"
Expand Down Expand Up @@ -2216,6 +2236,20 @@
semver "^7.3.2"
tsutils "^3.17.1"

"@typescript-eslint/typescript-estree@4.8.2":
version "4.8.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.8.2.tgz#eeec34707d8577600fb21661b5287226cc8b3bed"
integrity sha512-HToGNwI6fekH0dOw3XEVESUm71Onfam0AKin6f26S2FtUmO7o3cLlWgrIaT1q3vjB3wCTdww3Dx2iGq5wtUOCg==
dependencies:
"@typescript-eslint/types" "4.8.2"
"@typescript-eslint/visitor-keys" "4.8.2"
debug "^4.1.1"
globby "^11.0.1"
is-glob "^4.0.1"
lodash "^4.17.15"
semver "^7.3.2"
tsutils "^3.17.1"

"@typescript-eslint/visitor-keys@3.10.1":
version "3.10.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz#cd4274773e3eb63b2e870ac602274487ecd1e931"
Expand All @@ -2231,6 +2265,14 @@
"@typescript-eslint/types" "4.7.0"
eslint-visitor-keys "^2.0.0"

"@typescript-eslint/visitor-keys@4.8.2":
version "4.8.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.8.2.tgz#62cd3fbbbf65f8eccfbe6f159eb1b84a243a3f77"
integrity sha512-Vg+/SJTMZJEKKGHW7YC21QxgKJrSbxoYYd3MEUGtW7zuytHuEcksewq0DUmo4eh/CTNrVJGSdIY9AtRb6riWFw==
dependencies:
"@typescript-eslint/types" "4.8.2"
eslint-visitor-keys "^2.0.0"

"@webassemblyjs/ast@1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964"
Expand Down Expand Up @@ -5062,7 +5104,7 @@ eslint-plugin-react@^7.20.3, eslint-plugin-react@^7.21.5:
resolve "^1.18.1"
string.prototype.matchall "^4.0.2"

eslint-plugin-testing-library@^3.1.3, eslint-plugin-testing-library@^3.9.2:
eslint-plugin-testing-library@^3.9.2:
version "3.10.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-3.10.0.tgz#8c3c9c475bb4e5794446920d363403ae5bcf7f1c"
integrity sha512-zqITQ9qS9tdTG5hY+JnY4k3osolg4sGMD9gTnJr0L1xKB8CvPXXts7tp331ZjQ6qL37kRgH0288/XtsG+bcsxQ==
Expand Down Expand Up @@ -11883,10 +11925,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@~4.0.5:
version "4.0.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389"
integrity sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==
typescript@~4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9"
integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==

unbzip2-stream@^1.3.3:
version "1.4.3"
Expand Down

0 comments on commit 04623e9

Please sign in to comment.