lib/rules/keyword-spacing.js
function checkSpacingForModuleDeclaration(node) {
            const firstToken = sourceCode.getFirstToken(node);

            checkSpacingBefore(firstToken, PREV_TOKEN_M);
            checkSpacingAfter(firstToken, NEXT_TOKEN_M);

            if (node.type === "ExportDefaultDeclaration") {
                checkSpacingAround(sourceCode.getTokenAfter(firstToken));
            }

            if (node.source) {
                const fromToken = sourceCode.getTokenBefore(node.source);

                checkSpacingBefore(fromToken, PREV_TOKEN_M);
                checkSpacingAfter(fromToken, NEXT_TOKEN_M);
            }
        }
function checkSpacingForModuleDeclaration(node) {
            const firstToken = sourceCode.getFirstToken(node);

            checkSpacingBefore(firstToken, PREV_TOKEN_M);
            checkSpacingAfter(firstToken, NEXT_TOKEN_M);

            if (node.type === "ExportDefaultDeclaration") {
                checkSpacingAround(sourceCode.getTokenAfter(firstToken));
            }

            if (node.source) {
                const fromToken = sourceCode.getTokenBefore(node.source);

                checkSpacingBefore(fromToken, PREV_TOKEN_M);
                checkSpacingAfter(fromToken, NEXT_TOKEN_M);
            }
        }
function checkSpacingForModuleDeclaration ( node ) { const firstToken = sourceCode . getFirstToken ( node ) ; checkSpacingBefore ( firstToken , PREV_TOKEN_M ) ; checkSpacingAfter ( firstToken , NEXT_TOKEN_M ) ; if ( node . type === "ExportDefaultDeclaration" ) { checkSpacingAround ( sourceCode . getTokenAfter ( firstToken ) ) ; } if ( node . source ) { const fromToken = sourceCode . getTokenBefore ( node . source ) ; checkSpacingBefore ( fromToken , PREV_TOKEN_M ) ; checkSpacingAfter ( fromToken , NEXT_TOKEN_M ) ; } }
Reports `import`, `export`, `as`, and `from` keywords of a given node if
usage of spacing around those keywords is invalid.

This rule handles the `*` token in module declarations.

import*as A from "./a"; /*error Expected space(s) after "import".
error Expected space(s) before "as".

@param {ASTNode} node - A node to report.
@returns {void}
Reports import export as and from keywords of a given node if usage of spacing around those keywords is invalid .