Skip to content

Commit 2e4ace5

Browse files
fix(deps): update eslint txo packages (#285)
* fix(deps): update eslint txo packages * fix: migrate to ts and add test setup * chore: update scripts for typescript files --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Erik Slovak <erik.slovak@technologystudio.sk>
1 parent f80500f commit 2e4ace5

File tree

10 files changed

+151
-162
lines changed

10 files changed

+151
-162
lines changed

.eslintignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1+
/lib
12
commitlint.config.js
2-
jest.config.js
3-
lib
43
release.config.js

.eslintrc.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
2-
"extends": "./src/index.js",
2+
"extends": "./lib/index.js",
3+
"overrides": [
4+
{
5+
"files": ["test/**/*"],
6+
"parserOptions": {
7+
"project": "./tsconfig.test.json"
8+
}
9+
}
10+
],
311
"rules": {
412
"prefer-destructuring": "off"
513
},

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "eslint-config-txo-typescript-react",
33
"version": "1.2.0",
44
"description": "Technology Studio - Eslint typescript react config",
5-
"main": "src/index.js",
5+
"main": "lib/index.js",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/technology-studio/eslint-config-txo-typescript-react.git"
@@ -18,13 +18,14 @@
1818
"lint": "eslint --format=node_modules/eslint-formatter-pretty --ext .jsx,.js,.ts,.tsx .",
1919
"fixcode": "eslint --format=node_modules/eslint-formatter-pretty --ext .jsx,.js,.ts,.tsx . --fix",
2020
"git-hook": "yarn -s lint-staged",
21-
"test": "yarn lint",
22-
"prepare": "husky install",
23-
"sanity": "yarn lint && tsc --noEmit && yarn outdated && echo 'success'",
21+
"test": "yarn compile && yarn lint",
22+
"compile": "tsc",
23+
"prepare": "husky install && yarn compile",
24+
"sanity": "yarn test && yarn outdated && echo 'success'",
2425
"semantic-release": "semantic-release"
2526
},
2627
"dependencies": {
27-
"eslint-config-txo-typescript": "^3.2.55"
28+
"eslint-config-txo-typescript": "^3.2.60"
2829
},
2930
"peerDependencies": {
3031
"eslint-plugin-jsx-a11y": "^6.7.1",
@@ -38,14 +39,14 @@
3839
"@semantic-release/changelog": "^6.0.3",
3940
"@semantic-release/git": "^10.0.1",
4041
"@types/react": "^18.2.15",
41-
"@typescript-eslint/eslint-plugin": "^5.62.0",
42-
"@typescript-eslint/parser": "^5.62.0",
42+
"@typescript-eslint/eslint-plugin": "^6.1.0",
43+
"@typescript-eslint/parser": "^6.1.0",
4344
"commitizen": "^4.3.0",
44-
"eslint": "^8.44.0",
45+
"eslint": "^8.45.0",
4546
"eslint-formatter-pretty": "^5.0.0",
4647
"eslint-plugin-eslint-comments": "^3.2.0",
4748
"eslint-plugin-import": "^2.27.5",
48-
"eslint-plugin-jest": "^27.2.2",
49+
"eslint-plugin-jest": "^27.2.3",
4950
"eslint-plugin-jsx-a11y": "^6.7.1",
5051
"eslint-plugin-n": "^16.0.1",
5152
"eslint-plugin-promise": "^6.1.1",

src/configs/jsx-a11y.js renamed to src/configs/jsx-a11y.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ module.exports = {
1313
// NOTE: If this error triggers, either disable it or add
1414
// your custom components, labels and attributes via these options
1515
// See https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-associated-control.md
16-
controlComponents: ['Input']
17-
}
16+
controlComponents: ['Input'],
17+
},
1818
],
1919
'jsx-a11y/mouse-events-have-key-events': 'error',
2020
'jsx-a11y/role-has-required-aria-props': 'error',
21-
'jsx-a11y/role-supports-aria-props': 'error'
22-
}
21+
'jsx-a11y/role-supports-aria-props': 'error',
22+
},
2323
}

src/configs/react.js renamed to src/configs/react.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ module.exports = {
1010
'react-hooks/exhaustive-deps': 'error',
1111
'react/jsx-first-prop-new-line': ['error', 'multiline'],
1212
'react/jsx-uses-vars': 'error',
13-
'react/display-name': 'off'
14-
}
13+
'react/display-name': 'off',
14+
},
1515
}

src/configs/redux-saga.js renamed to src/configs/redux-saga.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
module.exports = {
88
rules: {
99
'redux-saga/no-yield-in-race': 'error',
10-
'redux-saga/yield-effects': 'error'
11-
}
10+
'redux-saga/yield-effects': 'error',
11+
},
1212
}

src/index.js renamed to src/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ module.exports = {
1111
...[
1212
'./configs/jsx-a11y',
1313
'./configs/react',
14-
'./configs/redux-saga'
15-
].map(require.resolve)
14+
'./configs/redux-saga',
15+
].map(relativePath => require.resolve(relativePath)),
1616
],
1717
parser: '@typescript-eslint/parser',
1818
plugins: [
1919
'@typescript-eslint',
2020
'redux-saga',
2121
'react',
2222
'react-hooks',
23-
'jsx-a11y'
23+
'jsx-a11y',
2424
],
2525
parserOptions: {
2626
ecmaVersion: 6,
2727
sourceType: 'module',
2828
ecmaFeatures: {
29-
jsx: true
29+
jsx: true,
3030
},
31-
project: './tsconfig.json'
31+
project: './tsconfig.json',
3232
},
3333
rules: {
34-
strict: 'error'
35-
}
34+
strict: 'error',
35+
},
3636
}

tsconfig.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
{
22
"compilerOptions": {
3-
"esModuleInterop": true,
43
"lib": ["esnext"],
54
"strict": true,
65
"noImplicitAny": true,
76
"noImplicitThis": true,
87
"alwaysStrict": true,
98
"strictBindCallApply": true,
109
"strictFunctionTypes": true,
11-
"sourceMap": true
10+
"sourceMap": true,
11+
"outDir": "lib"
1212
},
1313
"include": [
14-
"test/**/*",
15-
"lib/**/*"
14+
"src/**/*"
1615
]
1716
}

tsconfig.test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": true,
5+
},
6+
"include": [
7+
"test/**/*"
8+
]
9+
}

0 commit comments

Comments
 (0)