Skip to content
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

Add imports / exports lint rules #8

Merged
merged 2 commits into from
Dec 6, 2022
Merged

Add imports / exports lint rules #8

merged 2 commits into from
Dec 6, 2022

Conversation

SuperSodaSea
Copy link
Member

See pixijs/pixijs#8932 for details.

ESLint plugin eslint-plugin-import and eslint-plugin-simple-import-sort are added.

The following ESLint rules are added or modified:

{
    "no-multi-spaces": [1, { "exceptions": {} }],
    "object-curly-newline": [1, { "multiline": true, "consistent": true }],

    "import/first": 1,
    "import/newline-after-import": 1,
    "simple-import-sort/imports": [1, {
        "groups": [
            [
                "^\\w", // External
                "^\\u0000", // External side effect
                "^@pixi/", // @pixi/*
                "^\\u0000@pixi/", // @pixi/* side effect
                "^\\.", // Relative
                "^\\u0000\\.", // Relative side effect
                "^" // Others
            ],
            [
                "^\\w.*\\u0000$", // External types
                "^@pixi/.*\\u0000$", // @pixi/* types
                "^\\..*\\u0000$", // Relative types
                "\\u0000$" // Other types
            ]
        ]
    }],
    "simple-import-sort/exports": 1
}

Also the indent of index.js is fixed (originally mixed 2 and 4 spaces, now 4 spaces).

@SuperSodaSea
Copy link
Member Author

@bigtimebuddy By the way, do you think it's a good idea to apply the lint rules to @pixi/eslint-config itself? (Adding a .eslintrc.json that contains { "extends": ["./index.js"] })

@SuperSodaSea SuperSodaSea marked this pull request as ready for review December 6, 2022 14:35
@bigtimebuddy bigtimebuddy merged commit f055a6e into main Dec 6, 2022
@bigtimebuddy bigtimebuddy deleted the lint/imports branch December 6, 2022 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants