File tree 7 files changed +26
-10
lines changed
examples/recommended-config
packages/eslint-plugin-react-prefer-function-component
7 files changed +26
-10
lines changed Original file line number Diff line number Diff line change 16
16
node-version-file : " .nvmrc"
17
17
cache : " pnpm"
18
18
- 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)
20
20
# run again to link bin that is now available after package:build
21
21
- run : pnpm install --frozen-lockfile
22
22
- run : pnpm lint
Original file line number Diff line number Diff line change 14
14
cache : " pnpm"
15
15
registry-url : " https://registry.npmjs.org"
16
16
- 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
19
19
env :
20
20
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## v3.2.0
4
+
5
+ - The plugin's recommended configuration has been fixed, so ` plugins ` can be dropped from your ` .eslintrc ` when using the recommended settings:
6
+
7
+ ``` diff
8
+ module.exports = {
9
+ - plugins: ["react-prefer-function-component"],
10
+ extends: ["plugin:react-prefer-function-component/recommended"],
11
+ };
12
+
13
+ Thanks @alecmev!
14
+ ```
15
+
3
16
## v3.1.0
4
17
5
18
- New option: ` allowJsxUtilityClass ` . This configuration option permits JSX utility classes: classes that have methods that return JSX but are not themselves components(they do not extend from a Component class or have a render method).
Original file line number Diff line number Diff line change @@ -7,6 +7,5 @@ module.exports = {
7
7
jsx : true ,
8
8
} ,
9
9
} ,
10
- plugins : [ "react-prefer-function-component" ] ,
11
10
extends : [ "plugin:react-prefer-function-component/recommended" ] ,
12
11
} ;
Original file line number Diff line number Diff line change 18
18
"lint:fix:package" : " prettier-package-json --write package.json" ,
19
19
"prepare" : " husky install" ,
20
20
"test" : " pnpm jest" ,
21
- "test:ci" : " pnpm test --coverage" ,
22
- "typecheck" : " pnpm tsc --noEmit "
21
+ "test:ci" : " pnpm jest --coverage" ,
22
+ "typecheck" : " pnpm run --recursive typecheck "
23
23
},
24
24
"devDependencies" : {
25
25
"@babel/preset-env" : " ^7.22.9" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " eslint-plugin-react-prefer-function-component" ,
3
- "version" : " 3.1 .0" ,
3
+ "version" : " 3.2 .0" ,
4
4
"description" : " ESLint plugin that prevents the use of JSX class components" ,
5
5
"license" : " MIT" ,
6
6
"author" :
" Tate <[email protected] >" ,
12
12
"bugs" : {
13
13
"url" : " https://github.com/tatethurston/eslint-plugin-react-prefer-function-component/issues"
14
14
},
15
- "main" : " index.js" ,
15
+ "main" : " dist/ index.js" ,
16
16
"scripts" : {
17
17
"build" : " pnpm clean && pnpm tsc" ,
18
18
"clean" : " rm -rf dist/*" ,
19
19
"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"
21
22
},
22
23
"types" : " index.d.ts" ,
23
24
"keywords" : [
Original file line number Diff line number Diff line change
1
+ import type { ESLint } from "eslint" ;
1
2
import PreferFunctionComponent from "./prefer-function-component" ;
2
3
3
- module . exports = {
4
+ const plugin : ESLint . Plugin = {
4
5
configs : {
5
6
recommended : {
6
7
plugins : [ "react-prefer-function-component" ] ,
@@ -14,3 +15,5 @@ module.exports = {
14
15
"react-prefer-function-component" : PreferFunctionComponent ,
15
16
} ,
16
17
} ;
18
+
19
+ module . exports = plugin ;
You can’t perform that action at this time.
0 commit comments