lib/rules/script-indent.js
function validateBaseIndent(line, actualText, expectedIndent) {
                const expectedBaseIndentText = expectedIndent.baseIndentText
                if (
                    expectedBaseIndentText &&
                    (actualText.length < expectedBaseIndentText.length ||
                        !actualText.startsWith(expectedBaseIndentText))
                ) {
                    context.report({
                        loc: {
                            start: { line, column: 0 },
                            end: {
                                line,
                                column: actualText.length,
                            },
                        },
                        messageId: actualText
                            ? "unexpectedBaseIndentation"
                            : "missingBaseIndentation",
                        data: {
                            expected: JSON.stringify(expectedBaseIndentText),
                            actual: actualText
                                ? JSON.stringify(
                                      actualText.slice(
                                          0,
                                          expectedBaseIndentText.length
                                      )
                                  )
                                : "",
                        },
                        fix: defineFix(line, actualText, expectedIndent),
                    })
                    return false
                }
                return true
            }
function validateBaseIndent(line, actualText, expectedIndent) {
                const expectedBaseIndentText = expectedIndent.baseIndentText
                if (
                    expectedBaseIndentText &&
                    (actualText.length < expectedBaseIndentText.length ||
                        !actualText.startsWith(expectedBaseIndentText))
                ) {
                    context.report({
                        loc: {
                            start: { line, column: 0 },
                            end: {
                                line,
                                column: actualText.length,
                            },
                        },
                        messageId: actualText
                            ? "unexpectedBaseIndentation"
                            : "missingBaseIndentation",
                        data: {
                            expected: JSON.stringify(expectedBaseIndentText),
                            actual: actualText
                                ? JSON.stringify(
                                      actualText.slice(
                                          0,
                                          expectedBaseIndentText.length
                                      )
                                  )
                                : "",
                        },
                        fix: defineFix(line, actualText, expectedIndent),
                    })
                    return false
                }
                return true
            }
function validateBaseIndent ( line , actualText , expectedIndent ) { const expectedBaseIndentText = expectedIndent . baseIndentText if ( expectedBaseIndentText && ( actualText . length < expectedBaseIndentText . length || ! actualText . startsWith ( expectedBaseIndentText ) ) ) { context . report ( { loc : { start : { line , column : 0 } , end : { line , column : actualText . length , } , } , messageId : actualText ? "unexpectedBaseIndentation" : "missingBaseIndentation" , data : { expected : JSON . stringify ( expectedBaseIndentText ) , actual : actualText ? JSON . stringify ( actualText . slice ( 0 , expectedBaseIndentText . length ) ) : "" , } , fix : defineFix ( line , actualText , expectedIndent ) , } ) return false } return true }
Validate base point indentation.
@param {number} line The number of line.
@param {string} actualText The actual indentation text.
@param {ExpectedIndent} expectedIndent The expected indent.
@returns {void}
Validate base point indentation .