mirror of
https://github.com/sasjs/lint.git
synced 2026-01-06 20:20:06 +00:00
feat(*): add line endings rule, add automatic formatting for fixable violations
This commit is contained in:
21
src/formatExample.ts
Normal file
21
src/formatExample.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { formatText } from './format/formatText'
|
||||
import { lintText } from './lint'
|
||||
|
||||
const content = `%put 'Hello';
|
||||
%put 'World';
|
||||
%macro somemacro()
|
||||
%put 'test';
|
||||
%mend;\r\n`
|
||||
|
||||
console.log(content)
|
||||
lintText(content).then((diagnostics) => {
|
||||
console.log('Before Formatting:')
|
||||
console.table(diagnostics)
|
||||
formatText(content).then((formattedText) => {
|
||||
lintText(formattedText).then((newDiagnostics) => {
|
||||
console.log('After Formatting:')
|
||||
console.log(formattedText)
|
||||
console.table(newDiagnostics)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user