Skip to content

Commit 427e03d

Browse files
authored
fix: last line strip indentation
2 parents eef6572 + 2ead98d commit 427e03d

File tree

3 files changed

+82
-39
lines changed

3 files changed

+82
-39
lines changed

package-lock.json

Lines changed: 79 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"dependencies": {
88
"astring": "^1.8.3",
99
"debug": "^4.3.4",
10-
"dedent": "^1.5.1",
1110
"lodash": "^4.17.21",
1211
"pg-formatter": "^2.0.2",
12+
"redent": "^4.0.0",
1313
"sql-parse": "^0.1.5"
1414
},
1515
"description": "SQL linting rules for ESLint.",

src/rules/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import isSqlQuery from '../utilities/isSqlQuery';
22
import { generate } from 'astring';
33
import { format } from 'pg-formatter';
4-
import stripIndent from 'strip-indent';
4+
import redent from 'redent';
55

66
const create = (context) => {
77
const placeholderRule = context.settings?.sql?.placeholderRule;
@@ -48,7 +48,7 @@ const create = (context) => {
4848
}
4949

5050
if (ignoreBaseIndent) {
51-
literal = stripIndent(literal);
51+
literal = redent(literal);
5252
}
5353

5454
let formatted = format(literal, context.options[1]);

0 commit comments

Comments
 (0)