Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
625 views
in Technique[技术] by (71.8m points)

reactjs - Eslintrc.js | Definition for rule 'simple-import-sort/sort' was not found simple-import-sort/sort

Here is my eslintrc.js file:

module.exports = {
    "env": {
        "browser": true,
        "es2021": true
    },
    "extends": [
        "eslint:recommended",
        "plugin:react/recommended"
    ],
    "parserOptions": {
        "ecmaFeatures": {
            "jsx": true
        },
        "ecmaVersion": 12,
        "sourceType": "module"
    },
    "plugins": [
        "react",
        "simple-import-sort",
        "eslint-plugin-simple-import-sort",
    ],
    "rules": {
        /*code removed*/
        'sort-imports': 'off',
        'lines-between-class-members': [
            'error',
            'always'
        ],
        'simple-import-sort/sort': [
            'error',
            // fixed by reporting in https://github.com/lydell/eslint-plugin-simple-import-sort/issues/54
            {
                groups: [
                    [
                        '^@?[a-z]'
                    ], // anything that starts with @ and lowercase
                    [
                        '^[^.\u0000]'
                    ], // anything but a dot and side effect imports
                    [
                        '^\.'
                    ], // starting with dot
                    [
                        '^\u0000'
                    ] // side effect imports
                ]
            }
        ],
        'react/jsx-curly-spacing': [
            2,
            {
                when: 'always',
                allowMultiline: false,
                children: true
            }
        ],
        'max-len': [
            'error',
            {
                code: 150,
                ignorePattern: 'logger.'
            }
        ]
    },
    "parser": "babel-eslint"
};

Already tried: Definition for rule 'simple-import-sort/sort' was not found simple-import-sort/sort

and https://github.com/lydell/eslint-plugin-simple-import-sort#usage

Could anybody please suggest?

Thanks.

question from:https://stackoverflow.com/questions/65652375/eslintrc-js-definition-for-rule-simple-import-sort-sort-was-not-found-simple

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...