Skip to content

Commit

Permalink
update to latest eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
joephela committed Jul 10, 2024
1 parent d7ba3f4 commit 50e9e39
Show file tree
Hide file tree
Showing 8 changed files with 1,354 additions and 1,849 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

16 changes: 0 additions & 16 deletions .eslintrc

This file was deleted.

40 changes: 40 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";

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

export default [{
ignores: ["**/lib/"],
}, ...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:sort/recommended",
), {
languageOptions: {
globals: {
...globals.jest,
...globals.node,
},

parser: tsParser,
},

plugins: {
"@typescript-eslint": typescriptEslint,
},

rules: {
"@typescript-eslint/no-non-null-assertion": "off",
},
}];
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@
"ts": "tsc -b"
},
"devDependencies": {
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@babel/preset-typescript": "^7.23.2",
"@changesets/cli": "^2.26.2",
"@types/jest": "^29.5.7",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"eslint": "^8.52.0",
"eslint-plugin-sort": "^2.11.0",
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@changesets/cli": "^2.27.7",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.6.0",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"eslint": "^9.6.0",
"eslint-plugin-sort": "^3.0.2",
"globals": "^15.8.0",
"jest": "^29.7.0",
"prettier": "^3.0.3",
"typescript": "^5.2.2"
"prettier": "^3.3.2",
"typescript": "^5.5.3"
}
}
2 changes: 1 addition & 1 deletion packages/eslint-config-widen/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Widen",
"dependencies": {
"eslint-config-prettier": "^9.0.0"
"eslint-config-prettier": "^9.1.0"
},
"description": "Widen's shared ESLint config.",
"exports": {
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-widen/src/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export = {
'react/jsx-curly-brace-presence': ['warn', 'never'],
'react/jsx-first-prop-new-line': ['error', 'multiline'],
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-useless-fragment' : 'error',
'react/jsx-sort-props': [
'error',
{
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin-widen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"author": "Widen",
"description": "Widen's own ESLint plugin containing custom lint rules for our code.",
"devDependencies": {
"@types/eslint": "^8.44.6",
"@types/estree-jsx": "^1.0.2",
"eslint": "^8.52.0",
"@types/eslint": "^8.56.10",
"@types/estree-jsx": "^1.0.5",
"eslint": "^9.6.0",
"tsheredoc": "^1.0.1"
},
"exports": "./lib/index.js",
Expand Down
Loading

0 comments on commit 50e9e39

Please sign in to comment.