Skip to content

Instantly share code, notes, and snippets.

@joshnavdev
Last active June 8, 2024 00:41
Show Gist options
  • Save joshnavdev/3634f849314358a58e044ba9edfa2fd0 to your computer and use it in GitHub Desktop.
Save joshnavdev/3634f849314358a58e044ba9edfa2fd0 to your computer and use it in GitHub Desktop.
EsLint + TypeScript + Prettier - Flat Config
semi: true
tabWidth: 2
printWidth: 120
singleQuote: true
endOfLine: auto
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
export default tseslint.config(
{
files: ['**/*.ts'],
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
rules: {
'no-console': 'warn',
'@typescript-eslint/no-unused-vars': 'error',
},
},
{
files: ['**/*.js', '**/*.mjs', '**/*.ts'],
extends: [eslintPluginPrettierRecommended],
rules: {
...eslintConfigPrettier.rules,
},
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment