File tree Expand file tree Collapse file tree 7 files changed +26
-10
lines changed
examples/recommended-config
packages/eslint-plugin-react-prefer-function-component Expand file tree Collapse file tree 7 files changed +26
-10
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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 }}
Original file line number Diff line number Diff line change 11# Changelog
22
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+
316## v3.1.0
417
518- 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 = {
77 jsx : true ,
88 } ,
99 } ,
10- plugins : [ "react-prefer-function-component" ] ,
1110 extends : [ "plugin:react-prefer-function-component/recommended" ] ,
1211} ;
Original file line number Diff line number Diff line change 1818 "lint:fix:package" : " prettier-package-json --write package.json" ,
1919 "prepare" : " husky install" ,
2020 "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 "
2323 },
2424 "devDependencies" : {
2525 "@babel/preset-env" : " ^7.22.9" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " eslint-plugin-react-prefer-function-component" ,
3- "version" : " 3.1 .0" ,
3+ "version" : " 3.2 .0" ,
44 "description" : " ESLint plugin that prevents the use of JSX class components" ,
55 "license" : " MIT" ,
66 "author" : " Tate <tatethurston@gmail.com>" ,
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" : [
Original file line number Diff line number Diff line change 1+ import type { ESLint } from "eslint" ;
12import 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 ;
You can’t perform that action at this time.
0 commit comments