Skip to content

Added support --fix-type #2619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 lib/rules/boolean-prop-naming.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ const propWrapperUtil = require('../util/propWrapper');

module.exports = {
meta: {
type: 'suggestion',
docs: {
category: 'Stylistic Issues',
description: 'Enforces consistent naming for boolean props',
recommended: false,
url: docsUrl('boolean-prop-naming')
},

schema: [{
additionalProperties: false,
properties: {
Expand Down
1 change: 1 addition & 0 deletions lib/rules/button-has-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const optionDefaults = {

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'Forbid "button" element without an explicit "type" attribute',
category: 'Possible Errors',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/default-props-match-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const docsUrl = require('../util/docsUrl');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Enforce all defaultProps are defined and not "required" in propTypes.',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/destructuring-assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const DEFAULT_OPTION = 'always';

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Enforce consistent usage of destructuring assignment of props, state, and context',
category: 'Stylistic Issues',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/display-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const propsUtil = require('../util/props');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Prevent missing displayName in a React component definition',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/forbid-component-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const DEFAULTS = ['className', 'style'];

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Forbid certain props on components',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/forbid-dom-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const DEFAULTS = [];

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Forbid certain props on DOM Nodes',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/forbid-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Forbid certain elements',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/forbid-foreign-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const ast = require('../util/ast');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Forbid using another component\'s propTypes',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/forbid-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const DEFAULTS = ['any', 'array', 'object'];

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Forbid certain propTypes',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/function-component-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function isFunctionExpressionWithName(node) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Standardize the way function component get defined',
category: 'Stylistic issues',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-boolean-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function isNever(configuration, exceptions, propName) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Enforce boolean attributes notation in JSX',
category: 'Stylistic Issues',
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-child-element-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ const INLINE_ELEMENTS = new Set([

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Ensures inline tags are not rendered without spaces between them',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-child-element-spacing')
},
fixable: null,
// fixable: null,
schema: [
{
type: 'object',
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-closing-bracket-location.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ const docsUrl = require('../util/docsUrl');
// ------------------------------------------------------------------------------
module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Validate closing bracket location in JSX',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-closing-bracket-location')
},
fixable: 'code',
fixable: 'whitespace',

schema: [{
oneOf: [
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-closing-tag-location.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const docsUrl = require('../util/docsUrl');
// ------------------------------------------------------------------------------
module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Validate closing tag location for multiline JSX',
category: 'Stylistic Issues',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-curly-brace-presence.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const DEFAULT_CONFIG = {props: OPTION_NEVER, children: OPTION_NEVER};

module.exports = {
meta: {
type: 'suggestion',
docs: {
description:
'Disallow unnecessary JSX expressions when literals alone are sufficient ' +
Expand Down
3 changes: 0 additions & 3 deletions lib/rules/jsx-curly-newline.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,13 @@ function getNormalizedOption(context) {
module.exports = {
meta: {
type: 'layout',

docs: {
description: 'Enforce consistent line breaks inside jsx curly',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-curly-newline')
},

fixable: 'whitespace',

schema: [
{
oneOf: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-curly-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ const SPACING_VALUES = [SPACING.always, SPACING.never];

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Enforce or disallow spaces inside of curly braces in JSX attributes',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-curly-spacing')
},
fixable: 'code',
fixable: 'whitespace',

schema: {
definitions: {
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-equals-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ const docsUrl = require('../util/docsUrl');

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Disallow or enforce spaces around equal signs in JSX attributes',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-equals-spacing')
},
fixable: 'code',
fixable: 'whitespace',

schema: [{
enum: ['always', 'never']
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-filename-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const DEFAULTS = {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Restrict file extensions that may contain JSX',
category: 'Stylistic Issues',
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-first-prop-new-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ const docsUrl = require('../util/docsUrl');

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Ensure proper position of the first property in JSX',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-first-prop-new-line')
},
fixable: 'code',
fixable: 'whitespace',

schema: [{
enum: ['always', 'never', 'multiline', 'multiline-multiprop']
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-fragments.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function replaceNode(source, node, text) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Enforce shorthand or standard form for React fragments',
category: 'Stylistic Issues',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-handler-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const docsUrl = require('../util/docsUrl');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Enforce event handler naming conventions in JSX',
category: 'Stylistic Issues',
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-indent-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ const docsUrl = require('../util/docsUrl');
// ------------------------------------------------------------------------------
module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Validate props indentation in JSX',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-indent-props')
},
fixable: 'code',
fixable: 'whitespace',

schema: [{
oneOf: [{
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const docsUrl = require('../util/docsUrl');
// ------------------------------------------------------------------------------
module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Validate JSX indentation',
category: 'Stylistic Issues',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const defaultOptions = {

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'Report missing `key` props in iterators/collection literals',
category: 'Possible Errors',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-max-depth.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const docsUrl = require('../util/docsUrl');
// ------------------------------------------------------------------------------
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Validate JSX maximum depth',
category: 'Stylistic Issues',
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-max-props-per-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ const docsUrl = require('../util/docsUrl');

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Limit maximum of props on a single line in JSX',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-max-props-per-line')
},
fixable: 'code',
fixable: 'whitespace',
schema: [{
type: 'object',
properties: {
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-no-bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const violationMessageStore = {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Prevents usage of Function.prototype.bind and arrow functions in React component props',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-no-comment-textnodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function checkText(node, context) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Comments inside children section of tag should be placed inside braces',
category: 'Possible Errors',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-no-duplicate-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const docsUrl = require('../util/docsUrl');

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'Enforce no duplicate props',
category: 'Possible Errors',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-no-literals.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function trimIfString(val) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Prevent using string literals in React component definition',
category: 'Stylistic Issues',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-no-script-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function shouldVerifyProp(node, config) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Forbid `javascript:` URLs',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-no-target-blank.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function hasSecureRel(element, allowReferrer) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Forbid target="_blank" attribute without rel="noopener noreferrer"',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-no-undef.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const jsxUtil = require('../util/jsx');

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'Disallow undeclared variables in JSX',
category: 'Possible Errors',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-one-expression-per-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const optionDefaults = {

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Limit to one expression per line in JSX',
category: 'Stylistic Issues',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-pascal-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const ALL_CAPS_TAG_REGEX = XRegExp('^[\\p{Lu}0-9]+([\\p{Lu}0-9_]*[\\p{Lu}0-9]+)?

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Enforce PascalCase for user-defined JSX components',
category: 'Stylistic Issues',
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-props-no-multi-spaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ const docsUrl = require('../util/docsUrl');

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'Disallow multiple spaces between inline JSX props',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-props-no-multi-spaces')
},
fixable: 'code',
fixable: 'whitespace',
schema: []
},

Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-props-no-spreading.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const DEFAULTS = {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Prevent JSX prop spreading',
category: 'Best Practices',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-sort-default-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const propWrapperUtil = require('../util/propWrapper');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Enforce default props alphabetical sorting',
category: 'Stylistic Issues',
Expand Down
Loading