Skip to content

Commit

Permalink
[meta] reflect the repo rename; remove travis badge
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Apr 15, 2022
1 parent e52eed5 commit 96b3b06
Show file tree
Hide file tree
Showing 24 changed files with 1,377 additions and 1,380 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test.yml
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
smoke-test:
if: ${{ github.repository == 'yannickcr/eslint-plugin-react' || github.event_name == 'workflow_dispatch' }}
if: ${{ github.repository == 'jsx-eslint/eslint-plugin-react' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
2,684 changes: 1,342 additions & 1,342 deletions CHANGELOG.md

Large diffs are not rendered by default.

21 changes: 9 additions & 12 deletions README.md
@@ -1,7 +1,7 @@
`eslint-plugin-react`
===================

[![Maintenance Status][status-image]][status-url] [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][deps-image]][deps-url] [![Code Climate][climate-image]][climate-url] [![Tidelift][tidelift-image]][tidelift-url]
[![Maintenance Status][status-image]][status-url] [![NPM version][npm-image]][npm-url] [![Dependency Status][deps-image]][deps-url] [![Code Climate][climate-image]][climate-url] [![Tidelift][tidelift-image]][tidelift-url]

React specific linting rules for `eslint`

Expand All @@ -25,7 +25,7 @@ Use [our preset](#recommended) to get reasonable defaults:
]
```

If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), extend [`react/jsx-runtime`](https://github.com/yannickcr/eslint-plugin-react/blob/c8917b0885094b5e4cc2a6f613f7fb6f16fe932e/index.js#L163-L176) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`) to disable the relevant rules.
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), extend [`react/jsx-runtime`](https://github.com/jsx-eslint/eslint-plugin-react/blob/c8917b0885094b5e4cc2a6f613f7fb6f16fe932e/index.js#L163-L176) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`) to disable the relevant rules.

You should also specify settings that will be shared across all the plugin rules. ([More about eslint shared settings](https://eslint.org/docs/user-guide/configuring/configuration-files#adding-shared-settings))

Expand Down Expand Up @@ -266,17 +266,14 @@ This pairs well with the `eslint:all` rule.
[npm-url]: https://npmjs.org/package/eslint-plugin-react
[npm-image]: https://img.shields.io/npm/v/eslint-plugin-react.svg

[travis-url]: https://travis-ci.org/yannickcr/eslint-plugin-react
[travis-image]: https://img.shields.io/travis/yannickcr/eslint-plugin-react/master.svg
[deps-url]: https://david-dm.org/jsx-eslint/eslint-plugin-react
[deps-image]: https://img.shields.io/david/dev/jsx-eslint/eslint-plugin-react.svg

[deps-url]: https://david-dm.org/yannickcr/eslint-plugin-react
[deps-image]: https://img.shields.io/david/dev/yannickcr/eslint-plugin-react.svg
[climate-url]: https://codeclimate.com/github/jsx-eslint/eslint-plugin-react
[climate-image]: https://img.shields.io/codeclimate/maintainability/jsx-eslint/eslint-plugin-react.svg

[climate-url]: https://codeclimate.com/github/yannickcr/eslint-plugin-react
[climate-image]: https://img.shields.io/codeclimate/maintainability/yannickcr/eslint-plugin-react.svg

[status-url]: https://github.com/yannickcr/eslint-plugin-react/pulse
[status-image]: https://img.shields.io/github/last-commit/yannickcr/eslint-plugin-react.svg
[status-url]: https://github.com/jsx-eslint/eslint-plugin-react/pulse
[status-image]: https://img.shields.io/github/last-commit/jsx-eslint/eslint-plugin-react.svg

[tidelift-url]: https://tidelift.com/subscription/pkg/npm-eslint-plugin-react?utm_source=npm-eslint-plugin-react&utm_medium=referral&utm_campaign=readme
[tidelift-image]: https://tidelift.com/badges/github/yannickcr/eslint-plugin-react?style=flat
[tidelift-image]: https://tidelift.com/badges/github/jsx-eslint/eslint-plugin-react?style=flat
4 changes: 2 additions & 2 deletions docs/rules/jsx-no-target-blank.md
Expand Up @@ -99,7 +99,7 @@ var Hello = <a target='_blank' href="https://example.com/"></form>

### Custom link components

This rule supports the ability to use custom components for links, such as `<Link />` which is popular in libraries like `react-router`, `next.js` and `gatsby`. To enable this, define your custom link components in the global [shared settings](https://github.com/yannickcr/eslint-plugin-react/blob/master/README.md#configuration) under the `linkComponents` configuration area. Once configured, this rule will check those components as if they were `<a />` elements.
This rule supports the ability to use custom components for links, such as `<Link />` which is popular in libraries like `react-router`, `next.js` and `gatsby`. To enable this, define your custom link components in the global [shared settings](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/README.md#configuration) under the `linkComponents` configuration area. Once configured, this rule will check those components as if they were `<a />` elements.

Examples of **incorrect** code for this rule:

Expand All @@ -119,7 +119,7 @@ var Hello = <Link />

### Custom form components

This rule supports the ability to use custom components for forms. To enable this, define your custom form components in the global [shared settings](https://github.com/yannickcr/eslint-plugin-react/blob/master/README.md#configuration) under the `formComponents` configuration area. Once configured, this rule will check those components as if they were `<form />` elements.
This rule supports the ability to use custom components for forms. To enable this, define your custom form components in the global [shared settings](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/README.md#configuration) under the `formComponents` configuration area. Once configured, this rule will check those components as if they were `<form />` elements.

## When To Override It

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-space-before-closing.md
@@ -1,6 +1,6 @@
# Validate spacing before closing bracket in JSX (react/jsx-space-before-closing)

**Deprecation notice**: This rule is deprecated. Please use the `"beforeSelfClosing"` option of the [jsx-tag-spacing](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md) rule instead.
**Deprecation notice**: This rule is deprecated. Please use the `"beforeSelfClosing"` option of the [jsx-tag-spacing](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md) rule instead.

Enforce or forbid spaces before the closing bracket of self-closing JSX elements.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-uses-react.md
Expand Up @@ -45,4 +45,4 @@ var Hello = <div>Hello {this.props.name}</div>;

If you are not using JSX, if React is declared as global variable, or if you do not use the `no-unused-vars` rule.

If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), you should disable this rule by extending [`react/jsx-runtime`](https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/index.js#L163-L176) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`).
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), you should disable this rule by extending [`react/jsx-runtime`](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/index.js#L163-L176) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`).
2 changes: 1 addition & 1 deletion docs/rules/no-array-index-key.md
Expand Up @@ -106,4 +106,4 @@ things.reduceRight((collection, thing) => (

## When Not To Use It

If there is nothing unique about the items, for example [you are breaking an array down in to chunks](https://github.com/yannickcr/eslint-plugin-react/issues/1123), then you may want to disable this rule with an override.
If there is nothing unique about the items, for example [you are breaking an array down in to chunks](https://github.com/jsx-eslint/eslint-plugin-react/issues/1123), then you may want to disable this rule with an override.
2 changes: 1 addition & 1 deletion docs/rules/no-find-dom-node.md
Expand Up @@ -2,7 +2,7 @@

Facebook will eventually deprecate `findDOMNode` as it blocks certain improvements in React in the future.

It is recommended to use callback refs instead. See [Dan Abramov comments and examples](https://github.com/yannickcr/eslint-plugin-react/issues/678#issue-165177220).
It is recommended to use callback refs instead. See [Dan Abramov comments and examples](https://github.com/jsx-eslint/eslint-plugin-react/issues/678#issue-165177220).

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/prefer-stateless-function.md
Expand Up @@ -11,7 +11,7 @@ This rule will check your class based React components for
* extension of `React.PureComponent` (if the `ignorePureComponents` flag is true)
* presence of `ref` attribute in JSX
* the use of decorators
* `render` method that return anything but JSX: `undefined`, `null`, etc. (only in React <15.0.0, see [shared settings](https://github.com/yannickcr/eslint-plugin-react/blob/master/README.md#configuration) for React version configuration)
* `render` method that return anything but JSX: `undefined`, `null`, etc. (only in React <15.0.0, see [shared settings](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/README.md#configuration) for React version configuration)

If none of these elements are found, the rule will warn you to write this component as a pure function.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/prop-types.md
Expand Up @@ -153,7 +153,7 @@ It would seem that some common properties such as `props.children` or `props.cla
(and alike) need to be treated as exceptions.

As it aptly noticed in
[#7](https://github.com/yannickcr/eslint-plugin-react/issues/7)
[#7](https://github.com/jsx-eslint/eslint-plugin-react/issues/7)

> Why should children be an exception?
> Most components don't need `this.props.children`, so that makes it extra important
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/react-in-jsx-scope.md
Expand Up @@ -44,4 +44,4 @@ var Hello = <div>Hello {this.props.name}</div>;

If you are not using JSX, or if you are setting `React` as a global variable.

If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), you should disable this rule by extending [`react/jsx-runtime`](https://github.com/yannickcr/eslint-plugin-react/blob/8cf47a8ac2242ee00ea36eac4b6ae51956ba4411/index.js#L165-L179) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`).
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), you should disable this rule by extending [`react/jsx-runtime`](https://github.com/jsx-eslint/eslint-plugin-react/blob/8cf47a8ac2242ee00ea36eac4b6ae51956ba4411/index.js#L165-L179) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`).
2 changes: 1 addition & 1 deletion lib/rules/no-deprecated.js
Expand Up @@ -85,7 +85,7 @@ module.exports = {
// 16.9.0
// For now the following life-cycle methods are just legacy, not deprecated:
// `componentWillMount`, `componentWillReceiveProps`, `componentWillUpdate`
// https://github.com/yannickcr/eslint-plugin-react/pull/1750#issuecomment-425975934
// https://github.com/jsx-eslint/eslint-plugin-react/pull/1750#issuecomment-425975934
deprecated.componentWillMount = [
'16.9.0',
'UNSAFE_componentWillMount',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unused-prop-types.js
Expand Up @@ -6,7 +6,7 @@
'use strict';

// As for exceptions for props.children or props.className (and alike) look at
// https://github.com/yannickcr/eslint-plugin-react/issues/7
// https://github.com/jsx-eslint/eslint-plugin-react/issues/7

const Components = require('../util/Components');
const docsUrl = require('../util/docsUrl');
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/prop-types.js
Expand Up @@ -6,7 +6,7 @@
'use strict';

// As for exceptions for props.children or props.className (and alike) look at
// https://github.com/yannickcr/eslint-plugin-react/issues/7
// https://github.com/jsx-eslint/eslint-plugin-react/issues/7

const Components = require('../util/Components');
const docsUrl = require('../util/docsUrl');
Expand Down
2 changes: 1 addition & 1 deletion lib/util/docsUrl.js
@@ -1,7 +1,7 @@
'use strict';

function docsUrl(ruleName) {
return `https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules/${ruleName}.md`;
return `https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/${ruleName}.md`;
}

module.exports = docsUrl;
4 changes: 2 additions & 2 deletions lib/util/propTypes.js
Expand Up @@ -1029,7 +1029,7 @@ module.exports = function propTypesInstructions(context, components, utils) {
return;
}

// https://github.com/yannickcr/eslint-plugin-react/issues/2784
// https://github.com/jsx-eslint/eslint-plugin-react/issues/2784
if (isInsideClassBody(node) && !astUtil.isFunction(node)) {
return;
}
Expand All @@ -1053,7 +1053,7 @@ module.exports = function propTypesInstructions(context, components, utils) {
markPropTypesAsDeclared(node, resolveTypeAnnotation(param));
}
} else {
// implements what's discussed here: https://github.com/yannickcr/eslint-plugin-react/issues/2777#issuecomment-683944481
// implements what's discussed here: https://github.com/jsx-eslint/eslint-plugin-react/issues/2777#issuecomment-683944481
const annotation = siblingIdentifier.typeAnnotation.typeAnnotation;

if (
Expand Down
2 changes: 1 addition & 1 deletion lib/util/version.js
Expand Up @@ -87,7 +87,7 @@ function getReactVersionFromContext(context) {
confVer = String(settingsVersion);
} else if (!warnedForMissingVersion) {
error('Warning: React version not specified in eslint-plugin-react settings. '
+ 'See https://github.com/yannickcr/eslint-plugin-react#configuration .');
+ 'See https://github.com/jsx-eslint/eslint-plugin-react#configuration .');
warnedForMissingVersion = true;
}
confVer = /^[0-9]+\.[0-9]+$/.test(confVer) ? `${confVer}.0` : confVer;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -23,10 +23,10 @@
],
"repository": {
"type": "git",
"url": "https://github.com/yannickcr/eslint-plugin-react"
"url": "https://github.com/jsx-eslint/eslint-plugin-react"
},
"homepage": "https://github.com/yannickcr/eslint-plugin-react",
"bugs": "https://github.com/yannickcr/eslint-plugin-react/issues",
"homepage": "https://github.com/jsx-eslint/eslint-plugin-react",
"bugs": "https://github.com/jsx-eslint/eslint-plugin-react/issues",
"dependencies": {
"array-includes": "^3.1.4",
"array.prototype.flatmap": "^1.2.5",
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/destructuring-assignment.js
Expand Up @@ -252,7 +252,7 @@ ruleTester.run('destructuring-assignment', rule, {
options: ['always', { ignoreClassFields: true }],
features: ['class fields'],
},
// https://github.com/yannickcr/eslint-plugin-react/issues/2911
// https://github.com/jsx-eslint/eslint-plugin-react/issues/2911
{
code: `
function Foo({ context }) {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/function-component-definition.js
Expand Up @@ -195,7 +195,7 @@ ruleTester.run('function-component-definition', rule, {
options: [{ namedComponents: 'function-declaration' }],
features: ['types'],
},
// https://github.com/yannickcr/eslint-plugin-react/issues/2765
// https://github.com/jsx-eslint/eslint-plugin-react/issues/2765
{
code: `
const obj = {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-access-state-in-setstate.js
Expand Up @@ -110,7 +110,7 @@ ruleTester.run('no-access-state-in-setstate', rule, {
parserOptions,
},
{
// https://github.com/yannickcr/eslint-plugin-react/pull/1611
// https://github.com/jsx-eslint/eslint-plugin-react/pull/1611
code: `
function testFunction({a, b}) {
};
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-typos.js
Expand Up @@ -290,7 +290,7 @@ ruleTester.run('no-typos', rule, {
parserOptions,
},
{
// https://github.com/yannickcr/eslint-plugin-react/issues/1353
// https://github.com/jsx-eslint/eslint-plugin-react/issues/1353
code: `
function test(b) {
return a.bind(b);
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-unused-prop-types.js
Expand Up @@ -2048,7 +2048,7 @@ ruleTester.run('no-unused-prop-types', rule, {
`,
},
{
// The next two test cases are related to: https://github.com/yannickcr/eslint-plugin-react/issues/1183
// The next two test cases are related to: https://github.com/jsx-eslint/eslint-plugin-react/issues/1183
code: `
export default function SomeComponent(props) {
const callback = () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/prop-types.js
Expand Up @@ -3344,7 +3344,7 @@ ruleTester.run('prop-types', rule, {
features: ['ts', 'no-babel'],
},
{
// issue: https://github.com/yannickcr/eslint-plugin-react/issues/2786
// issue: https://github.com/jsx-eslint/eslint-plugin-react/issues/2786
code: `
import React from 'react';
Expand Down

0 comments on commit 96b3b06

Please sign in to comment.