Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.34.0
1.34.1-next.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/monorepo",
"version": "1.34.0",
"version": "1.34.1-next.0",
"private": true,
"description": "Monorepo for eslint-plugin-react-[x, dom, web-api, hooks-extra, naming-convention].",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/core",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
"homepage": "https://github.com/Rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-debug/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-debug",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "ESLint React's ESLint plugin for debugging related rules.",
"keywords": [
"react",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-dom",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "ESLint React's ESLint plugin for React DOM related rules.",
"keywords": [
"react",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-hooks-extra",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "ESLint React's ESLint plugin for React Hooks related rules.",
"keywords": [
"react",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-naming-convention",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "ESLint React's ESLint plugin for naming convention related rules.",
"keywords": [
"react",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-web-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-web-api",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
"keywords": [
"react",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-x/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-x",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "A set of composable linting rules for libraries and frameworks that use React as a UI runtime.",
"keywords": [
"react",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import rule, { RULE_NAME } from "./no-context-provider";
ruleTester.run(RULE_NAME, rule, {
invalid: [
{
code: tsx`<Provider />`,
code: tsx`<context.Provider />`,
errors: [
{
messageId: "noContextProvider",
Expand Down Expand Up @@ -101,6 +101,26 @@ ruleTester.run(RULE_NAME, rule, {
},
},
},
// TODO: Evaluate the necessity of supporting this kind of usage
// {
// code: tsx`
// const Provider = Context.Provider;

// function Component() {
// return <Provider>hello world</Provider>;
// }
// `,
// errors: [
// {
// messageId: "noContextProvider",
// },
// ],
// settings: {
// "react-x": {
// version: "19.0.0",
// },
// },
// },
],
valid: [
{
Expand Down Expand Up @@ -151,5 +171,19 @@ ruleTester.run(RULE_NAME, rule, {
},
},
},
{
code: tsx`
import { Provider } from "jotai";

function Component() {
return <Provider>hello world</Provider>;
}
`,
settings: {
"react-x": {
version: "19.0.0",
},
},
},
],
});
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ export function create(context: RuleContext<MessageID, []>): RuleListener {
const contextFullName = parts.join(".");
const contextSelfName = parts.pop();
if (selfName !== "Provider") return;
if (contextSelfName == null) return;
context.report({
messageId: "noContextProvider",
node,
fix(fixer) {
if (contextSelfName == null) return null;
if (!isComponentNameLoose(contextSelfName)) return null;
const openingElement = node.openingElement;
const closingElement = node.closingElement;
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/eslint-plugin",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "More than 80 high-quality linting rules for writing better React code.",
"keywords": [
"react",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/shared",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "ESLint React's Shared constants and functions.",
"homepage": "https://github.com/Rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utilities/ast/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/ast",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "ESLint React's TSESTree AST utility module.",
"homepage": "https://github.com/Rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utilities/eff/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/eff",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "JavaScript and TypeScript utilities (previously some re-exports of the effect library).",
"homepage": "https://github.com/Rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utilities/jsx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/jsx",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "ESLint React's TSESTree AST utility module for static analysis of JSX.",
"homepage": "https://github.com/Rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utilities/var/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/var",
"version": "1.34.0",
"version": "1.34.1-next.0",
"description": "ESLint React's TSESTree AST utility module for static analysis of variables.",
"homepage": "https://github.com/Rel1cx/eslint-react",
"bugs": {
Expand Down