I'm struggling to resolve this problem, I've already checked the "traillingCommas" option an set it to all inside prettier, but eslint still yelling at me, for those who are wondering, there is the screenshot and my eslint config.
Insert `,`eslint(prettier/prettier)
When I Ctrl + S the file, a comma is inserted and removed right away, I don't know what is happening.
module.exports = {
env: {
browser: true,
es2021: true,
jest: true,
},
extends: [
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'standard',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react', 'jsx-a11y', '@typescript-eslint'],
rules: {
'prettier/prettier': [
'error',
{
printWidth: 80,
tabWidth: 2,
singleQuote: true,
arrowParens: 'always',
semi: true,
jsxSingleQuote: true,
traillingComma: "all",
},
],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'jsx-a11y/alt-text': [
'warn',
{
elements: ['img'],
img: ['Image'],
},
],
'jsx-a11y/aria-props': 'warn',
'jsx-a11y/aria-proptypes': 'warn',
'jsx-a11y/aria-unsupported-elements': 'warn',
'jsx-a11y/role-has-required-aria-props': 'warn',
'jsx-a11y/role-supports-aria-props': 'warn',
},
settings: {
react: {
version: 'detect',
},
'import/parsers': {
[require.resolve('@typescript-eslint/parser')]: ['.ts', '.tsx', '.d.ts'],
},
},
};
