lib/rules/script-indent.js
function processImportDefaultSpecifier() {
                    if (
                        secondSpecifier &&
                        secondSpecifier.type === "ImportNamespaceSpecifier"
                    ) {
                        // There is a pattern:
                        //     import Foo, * as foo from "foo"
                        tokens.push(
                            sourceCode.getFirstToken(firstSpecifier), // Foo
                            sourceCode.getTokenAfter(firstSpecifier), // comma
                            sourceCode.getFirstToken(secondSpecifier), // *
                            sourceCode.getLastToken(node, hasSemi ? 2 : 1), // from
                            sourceCode.getLastToken(node, hasSemi ? 1 : 0) // "foo"
                        )
                    } else {
                        // There are 3 patterns:
                        //     import Foo from "foo"
                        //     import Foo, {} from "foo"
                        //     import Foo, {a} from "foo"
                        const idToken = sourceCode.getFirstToken(firstSpecifier)
                        const nextToken = sourceCode.getTokenAfter(
                            firstSpecifier
                        )
                        if (isComma(nextToken)) {
                            const leftBrace = sourceCode.getTokenAfter(
                                nextToken
                            )
                            const rightBrace = sourceCode.getLastToken(
                                node,
                                hasSemi ? 3 : 2
                            )
                            setOffsetToToken(
                                [idToken, nextToken],
                                1,
                                importToken
                            )
                            setOffsetToToken(leftBrace, 0, idToken)
                            processNodeList(
                                node.specifiers.slice(1),
                                leftBrace,
                                rightBrace,
                                1
                            )
                            tokens.push(
                                sourceCode.getLastToken(node, hasSemi ? 2 : 1), // from
                                sourceCode.getLastToken(node, hasSemi ? 1 : 0) // "foo"
                            )
                        } else {
                            tokens.push(
                                idToken,
                                nextToken, // from
                                sourceCode.getTokenAfter(nextToken) // "foo"
                            )
                        }
                    }
                }
function processImportDefaultSpecifier() {
                    if (
                        secondSpecifier &&
                        secondSpecifier.type === "ImportNamespaceSpecifier"
                    ) {
                        // There is a pattern:
                        //     import Foo, * as foo from "foo"
                        tokens.push(
                            sourceCode.getFirstToken(firstSpecifier), // Foo
                            sourceCode.getTokenAfter(firstSpecifier), // comma
                            sourceCode.getFirstToken(secondSpecifier), // *
                            sourceCode.getLastToken(node, hasSemi ? 2 : 1), // from
                            sourceCode.getLastToken(node, hasSemi ? 1 : 0) // "foo"
                        )
                    } else {
                        // There are 3 patterns:
                        //     import Foo from "foo"
                        //     import Foo, {} from "foo"
                        //     import Foo, {a} from "foo"
                        const idToken = sourceCode.getFirstToken(firstSpecifier)
                        const nextToken = sourceCode.getTokenAfter(
                            firstSpecifier
                        )
                        if (isComma(nextToken)) {
                            const leftBrace = sourceCode.getTokenAfter(
                                nextToken
                            )
                            const rightBrace = sourceCode.getLastToken(
                                node,
                                hasSemi ? 3 : 2
                            )
                            setOffsetToToken(
                                [idToken, nextToken],
                                1,
                                importToken
                            )
                            setOffsetToToken(leftBrace, 0, idToken)
                            processNodeList(
                                node.specifiers.slice(1),
                                leftBrace,
                                rightBrace,
                                1
                            )
                            tokens.push(
                                sourceCode.getLastToken(node, hasSemi ? 2 : 1), // from
                                sourceCode.getLastToken(node, hasSemi ? 1 : 0) // "foo"
                            )
                        } else {
                            tokens.push(
                                idToken,
                                nextToken, // from
                                sourceCode.getTokenAfter(nextToken) // "foo"
                            )
                        }
                    }
                }
function processImportDefaultSpecifier ( ) { if ( secondSpecifier && secondSpecifier . type === "ImportNamespaceSpecifier" ) { // There is a pattern: //     import Foo, * as foo from "foo" tokens . push ( sourceCode . getFirstToken ( firstSpecifier ) , // Foo sourceCode . getTokenAfter ( firstSpecifier ) , // comma sourceCode . getFirstToken ( secondSpecifier ) , // * sourceCode . getLastToken ( node , hasSemi ? 2 : 1 ) , // from sourceCode . getLastToken ( node , hasSemi ? 1 : 0 ) // "foo" ) } else { // There are 3 patterns: //     import Foo from "foo" //     import Foo, {} from "foo" //     import Foo, {a} from "foo" const idToken = sourceCode . getFirstToken ( firstSpecifier ) const nextToken = sourceCode . getTokenAfter ( firstSpecifier ) if ( isComma ( nextToken ) ) { const leftBrace = sourceCode . getTokenAfter ( nextToken ) const rightBrace = sourceCode . getLastToken ( node , hasSemi ? 3 : 2 ) setOffsetToToken ( [ idToken , nextToken ] , 1 , importToken ) setOffsetToToken ( leftBrace , 0 , idToken ) processNodeList ( node . specifiers . slice ( 1 ) , leftBrace , rightBrace , 1 ) tokens . push ( sourceCode . getLastToken ( node , hasSemi ? 2 : 1 ) , // from sourceCode . getLastToken ( node , hasSemi ? 1 : 0 ) // "foo" ) } else { tokens . push ( idToken , nextToken , // from sourceCode . getTokenAfter ( nextToken ) // "foo" ) } } }
Process when the specifier is ImportDefaultSpecifier
@returns {void}
Process when the specifier is ImportDefaultSpecifier