Skip to content

Commit

Permalink
feat: migrate to flat eslint config (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-slovak authored Nov 10, 2023
1 parent dc25ad3 commit 7dc9e60
Show file tree
Hide file tree
Showing 7 changed files with 290 additions and 354 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
21 changes: 4 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,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 @@ -46,21 +46,8 @@
"@types/jest": "^29.5.8",
"@types/react": "~18.2.37",
"@types/react-native": "0.72.6",
"@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-react": "^1.2.60",
"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-jsx-a11y": "^6.7.1",
"eslint-plugin-n": "^16.2.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-redux-saga": "^1.3.2",
"eslint-config-txo-typescript-react": "^2.0.1",
"husky": "^8.0.3",
"jest": "^29.7.0",
"lint-staged": "^15.0.2",
Expand Down
Loading

0 comments on commit 7dc9e60

Please sign in to comment.