Skip to content

Instantly share code, notes, and snippets.

@JenHsuan
Created May 31, 2025 06:13
Show Gist options
  • Select an option

  • Save JenHsuan/205647f46b9f4903fcc1bbabca836dcb to your computer and use it in GitHub Desktop.

Select an option

Save JenHsuan/205647f46b9f4903fcc1bbabca836dcb to your computer and use it in GitHub Desktop.
...
import stylisticTs from '@stylistic/eslint-plugin-ts';
import stylisticJs from '@stylistic/eslint-plugin-js';
import stylisticJsx from '@stylistic/eslint-plugin-jsx';
import stylisticPlus from '@stylistic/eslint-plugin-plus';
import parserTs from '@typescript-eslint/parser';
const stylisticConfigs = [
{
plugins: {
'@stylistic/ts': stylisticTs,
'@stylistic/js': stylisticJs,
'@stylistic/jsx': stylisticJsx,
'@stylistic/plus': stylisticPlus,
},
files: [
'**/*.ts',
'**/*.tsx',
],
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
tsx: true
},
ecmaVersion: 2020,
useJSXTextNode: true,
parser: parserTs,
}
},
rules: {
'@stylistic/js/indent': ['error', 2],
'@stylistic/ts/semi': 1,
'@stylistic/js/no-whitespace-before-property': 'error',
'@stylistic/jsx/jsx-self-closing-comp': 'error'
},
},
];
export default defineConfig([
...,
stylisticConfigs
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment