Skip to content

Commit

Permalink
feat: migrate to flat eslint config (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-slovak authored Nov 10, 2023
1 parent 1ac485b commit 3fd68f8
Show file tree
Hide file tree
Showing 7 changed files with 254 additions and 478 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

13 changes: 0 additions & 13 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"*.{js,jsx,ts,tsx}": "eslint --cache --format=node_modules/eslint-formatter-pretty --ext .ts,.tsx"
"*.{js,jsx,ts,tsx}": "eslint --cache --max-warnings 0 --no-warn-ignored"
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.experimental.useFlatConfig": true
}
8 changes: 8 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const txoConfig = require('eslint-config-txo-typescript')

/** @type {import('eslint').Linter.FlatConfig[]} */
const config = [
...txoConfig.default,
]

module.exports = config
17 changes: 4 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"test:watch": "concurrently \"yarn build:watch\" \"jest --watch\"",
"coverage": "jest --coverage && open coverage/lcov-report/index.html || xdg-open coverage/lcov-report/index.html",
"compare-boilerplate-version": "./scripts/compare-boilerplate-version.sh",
"lint": "eslint --format=node_modules/eslint-formatter-pretty --ext .jsx,.js,.ts,.tsx .",
"fixcode": "eslint --format=node_modules/eslint-formatter-pretty --ext .jsx,.js,.ts,.tsx . --fix",
"lint": "eslint --max-warnings 0 .",
"fixcode": "eslint . --fix",
"git-hook": "yarn -s lint-staged",
"prepare": "husky install && yarn build",
"print-txo-packages": "yarn list 2> /dev/null|grep @txo|sed 's/.*\\(@txo[^@]*\\)@^*\\([^ ]*\\).*/\\1@\\2/g'|sort|uniq",
"sanity": "yarn lint && yarn build && tsc --noEmit && yarn test && yarn compare-boilerplate-version && echo 'success'",
"sanity": "yarn lint && yarn build && tsc --noEmit && yarn test --coverage && yarn compare-boilerplate-version && echo 'success'",
"semantic-release": "semantic-release",
"update-boilerplate-version": "./scripts/update-boilerplate-version.sh"
},
Expand All @@ -56,17 +56,8 @@
"@types/lodash.get": "^4.4.9",
"@types/node-fetch": "^2.6.9",
"@types/react": "^18.2.37",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"concurrently": "^8.2.2",
"eslint": "^8.52.0",
"eslint-config-txo-typescript": "^3.4.0",
"eslint-formatter-pretty": "^5.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-n": "^16.2.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-config-txo-typescript": "^4.0.3",
"graphql": "^16.8.1",
"husky": "^8.0.3",
"jest": "^29.7.0",
Expand Down
685 changes: 239 additions & 446 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 3fd68f8

Please sign in to comment.