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

Build for a more modern target #1286

Merged
merged 7 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading