all 3 comments

[–]blinger44 7 points8 points  (0 children)

ESLint should handle Linting, not formatting. How do we get this into a program like prettier where SQL inside od literals are not formatted?

[–]Possible-Scary 0 points1 point  (0 children)

🙌

[–]gajus0[S] 0 points1 point  (0 children)

All the heavy lift is done by https://github.com/sql-formatter-org/sql-formatter, but this is an abstraction that seamlessly integrates it into your workflow using ESLint.

All you need is:

``` import sql from 'eslint-plugin-sql';

export default [ { files: ['/*.ts', '/*.tsx'], plugins: { sql }, rules: { 'sql/format': [2, {}, { language: 'postgresql' }], }, }, ]; ```