Skip to content

Commit

Permalink
refactor eslint config (#1334)
Browse files Browse the repository at this point in the history
Signed-off-by: Brian DeHamer <bdehamer@github.com>
  • Loading branch information
bdehamer authored Dec 17, 2024
1 parent d7b528e commit b35f683
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 108 deletions.
2 changes: 2 additions & 0 deletions .changeset/pink-llamas-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
51 changes: 19 additions & 32 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/node_modules", "**/dist", "**/__generated__", "**/__fixtures__", "**/jest.config.js", "**/jest.config.base.js"],
}, ...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
), {
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
},
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: [
'**/dist',
'**/__generated__',
'**/__fixtures__',
'**/jest.config.js',
'**/jest.config.base.js',
],
},
eslint.configs.recommended,
tseslint.configs.recommended,
{
rules: {
"@typescript-eslint/no-unused-vars": ["error", { "caughtErrors": "none" }],
"@typescript-eslint/no-require-imports": "off"
'@typescript-eslint/no-unused-vars': ['error', { caughtErrors: 'none' }],
'@typescript-eslint/no-require-imports': 'off',
},
}];
}
);
159 changes: 86 additions & 73 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@
"@tsconfig/node16": "^16.1.3",
"@types/jest": "^29.5.14",
"@types/node": "^22.10.1",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"eslint": "^9.16.0",
"jest": "^29.7.0",
"nock": "^13.5.5",
"prettier": "^3.4.2",
"shx": "^0.3.3",
"typescript": "^5.7.2"
"typescript": "^5.7.2",
"typescript-eslint": "^8.18.0"
},
"workspaces": [
"./packages/*"
Expand Down

0 comments on commit b35f683

Please sign in to comment.