Skip to content

Commit 4d72bda

Browse files
committed
import type from eslint to avoid silly errors like #13
1 parent 6cfbc59 commit 4d72bda

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
node-version-file: ".nvmrc"
1717
cache: "pnpm"
1818
- run: pnpm install --frozen-lockfile
19-
- run: (cd packages/eslint-react-prefer-function-component && pnpm package:build)
19+
- run: (cd packages/eslint-plugin-react-prefer-function-component && pnpm package:build)
2020
# run again to link bin that is now available after package:build
2121
- run: pnpm install --frozen-lockfile
2222
- run: pnpm lint

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
cache: "pnpm"
1515
registry-url: "https://registry.npmjs.org"
1616
- run: pnpm install --frozen-lockfile
17-
- run: cp README.md LICENSE CHANGELOG.md packages/eslint-react-prefer-function-component
18-
- run: cd packages/eslint-react-prefer-function-component && pnpm package:build && npm publish
17+
- run: cp README.md LICENSE CHANGELOG.md packages/eslint-plugin-react-prefer-function-component
18+
- run: cd packages/eslint-plugin-react-prefer-function-component && pnpm package:build && npm publish
1919
env:
2020
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

examples/recommended-config/.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ module.exports = {
77
jsx: true,
88
},
99
},
10-
plugins: ["react-prefer-function-component"],
1110
extends: ["plugin:react-prefer-function-component/recommended"],
1211
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"prepare": "husky install",
2020
"test": "pnpm jest",
2121
"test:ci": "pnpm test --coverage",
22-
"typecheck": "pnpm tsc --noEmit"
22+
"typecheck": "pnpm run --recursive typecheck"
2323
},
2424
"devDependencies": {
2525
"@babel/preset-env": "^7.22.9",

packages/eslint-plugin-react-prefer-function-component/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
"bugs": {
1313
"url": "https://github.com/tatethurston/eslint-plugin-react-prefer-function-component/issues"
1414
},
15-
"main": "index.js",
15+
"main": "dist/index.js",
1616
"scripts": {
1717
"build": "pnpm clean && pnpm tsc",
1818
"clean": "rm -rf dist/*",
1919
"package:build": "pnpm build && pnpm package:prune",
20-
"package:prune": "find dist -name test.* -delete"
20+
"package:prune": "find dist -name test.* -delete",
21+
"typecheck": "tsc --noEmit"
2122
},
2223
"types": "index.d.ts",
2324
"keywords": [

packages/eslint-plugin-react-prefer-function-component/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import type { ESLint } from "eslint";
12
import PreferFunctionComponent from "./prefer-function-component";
23

3-
module.exports = {
4+
const plugin: ESLint.Plugin = {
45
configs: {
56
recommended: {
67
plugins: ["react-prefer-function-component"],
@@ -14,3 +15,5 @@ module.exports = {
1415
"react-prefer-function-component": PreferFunctionComponent,
1516
},
1617
};
18+
19+
module.exports = plugin;

0 commit comments

Comments
 (0)