Skip to content

Commit

Permalink
Build for a more modern target (#1286)
Browse files Browse the repository at this point in the history
* move in bundling changes from pr/load-error-messages

* some more eslint adjustments

* typecheck js

* changeset

* disable `checkJs` for now

---------

Co-authored-by: Jerel Miller <jerelmiller@gmail.com>
  • Loading branch information
phryneas and jerelmiller authored Mar 22, 2024
1 parent 3f60ac7 commit 11309f3
Show file tree
Hide file tree
Showing 14 changed files with 384 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-cameras-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"apollo-client-devtools": minor
---

Change transpilation target to create a smaller and more modern DevTools build.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.experimental.useFlatConfig": true,
"eslint.workingDirectories": ["./*"]
}
63 changes: 63 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import testingLibrary from "eslint-plugin-testing-library";
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
import jsxRuntime from "eslint-plugin-react/configs/jsx-runtime.js";
import hooksPlugin from "eslint-plugin-react-hooks";
import globals from "globals";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
reactRecommended,
jsxRuntime,
{
plugins: {
"testing-library": testingLibrary,
},
rules: testingLibrary.configs.react.rules,
},
{
plugins: {
"react-hooks": hooksPlugin,
},
// @ts-expect-error waiting for https://github.com/facebook/react/issues/28313
rules: hooksPlugin.configs.recommended.rules,
},
// original config contained a reference to jest-dom, but didn't configure any rules - skipping
{
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
...globals.webextensions,
},
},
rules: {
"react/prop-types": 0,
"react/no-unknown-property": "error",
"react/display-name": "off",
"testing-library/no-node-access": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{ ignoreRestSiblings: true },
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
disallowTypeAnnotations: false,
fixStyle: "separate-type-imports",
},
],
},
settings: {
react: {
version: "detect",
},
},
}
);
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
preset: "ts-jest",
setupFilesAfterEnv: ["./test.setup.ts"],
testEnvironment: "jsdom",
Expand Down
Loading

0 comments on commit 11309f3

Please sign in to comment.