willhoney7 / eslint-plugin-import-helpers

ESLint plugin to help enforce a configurable order for import statements
291 stars 17 forks source link

Cannot get alphabetize to work #5

Closed dantman closed 5 years ago

dantman commented 5 years ago
Configuration for rule "import/order" is invalid:
Value {"groups":[["builtin"],["parent","sibling","index"]],"newlines-between":"always","alphabetize":{"order":"asc","ignoreCase":true}} should NOT have additional properties.

I'm using the latest version and the plugin code seems to be ok:

    meta: {
        type: 'suggestion',
        docs: {
            url: '' // docsUrl('order'), TODO
        },

        fixable: 'code',
        schema: [{
            type: 'object',
            properties: {
                groups: {
                    type: 'array'
                },
                'newlines-between': {
                    enum: ['ignore', 'always', 'always-and-inside-groups', 'never']
                },
                alphabetize: {
                    type: 'object',
                    properties: {
                        order: {
                            enum: ['ignore', 'asc', 'desc'],
                            default: 'ignore'
                        },
                        ignoreCase: {
                            type: 'boolean',
                            default: false
                        }
                    }
                }
            },
            additionalProperties: false
        }]
    },

But when I include alphabetize in my config I always get that error.

dantman commented 5 years ago

Nevermind, this is because of #6. I was using the broken documentation that incorrectly used import/order instead of import-helpers/order-imports.