Skip to content

Eslint 8.0 error when using --fix: Fixable rules must set the meta.fixable property to "code" or "whitespace" #298

Closed
@idolize

Description

@idolize

Just updated to eslint 8.0 and getting a new error with this plugin.

See: https://eslint.org/docs/8.0.0/user-guide/migrating-to-8.0.0#rules-require-metafixable-to-provide-fixes

Here is the error stack:

Oops! Something went wrong! :(

ESLint: 8.0.1

Error: Fixable rules must set the `meta.fixable` property to "code" or "whitespace".
Occurred while linting /Users/test/components/Test.tsx:51
Rule: "react-native/sort-styles"
    at Object.report (/Users/test/node_modules/eslint/lib/linter/linter.js:940:35)
    at report (/Users/test/node_modules/eslint-plugin-react-native/lib/rules/sort-styles.js:62:13)
    at checkIsSorted (/Users/test/node_modules/eslint-plugin-react-native/lib/rules/sort-styles.js:98:16)
    at /Users/test/node_modules/eslint-plugin-react-native/lib/rules/sort-styles.js:127:13
    at Array.forEach (<anonymous>)
    at /Users/test/node_modules/eslint-plugin-react-native/lib/rules/sort-styles.js:126:31
    at Array.forEach (<anonymous>)
    at /Users/test/node_modules/eslint-plugin-react-native/lib/rules/sort-styles.js:120:26
    at Array.forEach (<anonymous>)
    at CallExpression (/Users/test/node_modules/eslint-plugin-react-native/lib/rules/sort-styles.js:119:30)

I always run eslint with --fix, so this is breaking my current workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions