Skip to content

Commit

Permalink
Fix eslint related dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
stanlemon committed Sep 16, 2023
1 parent 0208827 commit 02366de
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 898 deletions.
1 change: 0 additions & 1 deletion apps/react-pouchdb-example/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from "react";
import { render, act, screen, waitFor } from "@testing-library/react";
import PouchDB from "pouchdb";
import { App } from "./App";
Expand Down
2 changes: 0 additions & 2 deletions apps/react-pouchdb-example/src/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as React from "react";

export function Footer(): JSX.Element {
return (
<footer className="footer">
Expand Down
957 changes: 81 additions & 876 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ yargs(process.argv.slice(2))
preserveTimestamps: true,
recursive: true,
},
(e) => {
() => {
console.log("All done!");

Check warning on line 55 in packages/cli/index.js

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement

Check warning on line 55 in packages/cli/index.js

View workflow job for this annotation

GitHub Actions / publish-to-npm

Unexpected console statement
}
);
Expand Down
37 changes: 24 additions & 13 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
const fs = require("fs");

const dir = process.cwd();

const tsconfig = dir + "/tsconfig.json";
const tsconfigEslint = dir + "/tsconfig.eslint.json";

// If there is a tsconfig.eslint file, use that instead of the main one
// See: https://github.com/typescript-eslint/typescript-eslint/blob/main/docs/linting/TYPED_LINTING.md
const tsProject = fs.existsSync(tsconfigEslint) ? tsconfigEslint : tsconfig;

module.exports = {
env: {
es2021: true,
es2022: true,
browser: true,
node: true,
jest: true,
},
parserOptions: {
sourceType: "module",
},
extends: [
"react-app",
"eslint:recommended",
"plugin:jest/recommended",
"plugin:jest-dom/recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"typescript",
"typescript/react",
],
plugins: ["import"],
settings: {
react: {
version: "detect",
},
},
rules: {
// Requires strict equality
eqeqeq: "error",
Expand All @@ -38,19 +40,28 @@ module.exports = {
"no-console": "warn",
// Requires the displayName property to be set, not ideal for stateless components
"react/display-name": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-uses-react": "off",
"react/prop-types": "off",
// Allow exporting of unnamed objects as a default
"import/no-anonymous-default-export": [
"error",
{
allowObject: true,
},
],
"import/first": "error",
"import/no-amd": "error",
"import/no-webpack-loader-syntax": "error",
"import/no-unused-modules": "error",
"prettier/prettier": [
"error",
{
trailingComma: "es5",
},
],
"no-unused-vars": "warn",
"@typescript-eslint/no-unused-vars": "warn",
},
overrides: [
{
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"@typescript-eslint/parser": "^6.7.0",
"eslint": "^8.49.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-react-app": "^7.0.1",
"eslint-config-react": "^1.1.7",
"eslint-config-typescript": "^3.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.4.0",
"eslint-plugin-jest-dom": "^5.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @jest-environment jsdom
*/
/* eslint-disable max-lines-per-function */
import React from "react";
import PouchDB from "pouchdb";
import {
fireEvent,
Expand Down
1 change: 0 additions & 1 deletion packages/react-pouchdb/example/Counter.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { Counter } from "./Counter";
import { render, fireEvent, screen } from "@testing-library/react";
import "@testing-library/jest-dom";
Expand Down
1 change: 0 additions & 1 deletion packages/react-pouchdb/src/Database.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { render, waitFor, screen } from "@testing-library/react";
import "@testing-library/jest-dom";
import { Database } from "./Database";
Expand Down
2 changes: 1 addition & 1 deletion packages/webdev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@babel/cli": "^7.22.15",
"@babel/core": "^7.22.19",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-private-property-in-object": "^7.22.11",
"@babel/preset-env": "^7.22.15",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
Expand Down

0 comments on commit 02366de

Please sign in to comment.