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

Go Live #560

Merged
merged 14 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ Create a file in the root of your project named `eslint.config.js`, or `eslint.c
Populate it with the following content:

```js
import { config } from '@fishbrain/eslint-config-base';
import { config, looseTypes, configWithoutJest } from '@fishbrain/eslint-config-base';

export default [
...config,
...config, // or configWithoutJest if the project doesn't use Jest.
...looseTypes, // Use this if the project is poorly typed.
];
```

Finally you can run linting with a script in `package.json`. Note that we reference ESLint from `node_modules` directly
You can run linting with a script in `package.json`. Note that we reference ESLint from `node_modules` directly
as it's installed as a dependency of our config and is not available by calling `eslint`:

```json
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@fishbrain/eslint-config-monorepo",
"private": true,
"description": "ESLint configs for Fishbrain projects",
"version": "6.0.6",
"version": "6.0.7",
"workspaces": [
"packages/*"
],
Expand Down
13 changes: 13 additions & 0 deletions packages/base/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,16 @@ export const config = tseslint.config(
jestPlugin.configs['flat/recommended'],
customRules,
);

/* Use this if your project is not well typed yet (e.g. lots of `any` types). Ideally you should not use this, but in some cases it may be necessary. */
export const looseTypes = [
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
},
},
];
10 changes: 5 additions & 5 deletions packages/base/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "@fishbrain/eslint-config-base",
"packageManager": "[email protected]",
"version": "6.0.6",
"version": "6.0.7",
"type": "module",
"exports": "./index.js",
"scripts": {
"test": "eslint index.js eslint.config.js"
},
"dependencies": {
"@eslint/js": "^9.9.1",
"eslint": "^9.9.1",
"eslint-plugin-jest": "^28.8.1",
"@eslint/js": "^9.10.0",
"eslint": "^9.10.0",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3",
"typescript-eslint": "^8.3.0"
"typescript-eslint": "^8.4.0"
},
"peerDependencies": {
"typescript": "^5.5.4"
Expand Down
3 changes: 3 additions & 0 deletions packages/react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import globals from 'globals';
import {
config as baseConfig,
configWithoutJest as baseConfigWithoutJest,
looseTypes as baseLooseTypes,
} from '@fishbrain/eslint-config-base';

const reactConfig = [
Expand Down Expand Up @@ -56,3 +57,5 @@ export const configWithoutJest = tseslint.config(
...reactConfig,
customRules,
);

export const looseTypes = baseLooseTypes;
12 changes: 6 additions & 6 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fishbrain/eslint-config-react",
"packageManager": "[email protected]",
"version": "6.0.6",
"version": "6.0.7",
"type": "module",
"exports": "./index.js",
"scripts": {
Expand All @@ -12,14 +12,14 @@
"typescript": "^5.5.4"
},
"dependencies": {
"@eslint/js": "^9.9.1",
"@eslint/js": "^9.10.0",
"@fishbrain/eslint-config-base": "workspace:^",
"eslint": "^9.9.1",
"eslint": "^9.10.0",
"eslint-plugin-compat": "^6.0.0",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.35.2",
"globals": "^15.9.0",
"typescript-eslint": "^8.3.0"
"typescript-eslint": "^8.4.0"
},
"peerDependencies": {
"react": "^18"
Expand Down
Loading