Skip to content

Commit

Permalink
add self closing (#14)
Browse files Browse the repository at this point in the history
Co-authored-by: kanary <[email protected]>
  • Loading branch information
Kanary159357 and kanary authored Apr 22, 2024
1 parent cd06c43 commit ffd0ab6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-schools-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@channel.io/eslint-config": patch
---

Add self-closing error for eslint-config
35 changes: 24 additions & 11 deletions packages/eslint-config/rules/react.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
module.exports = {
parserOptions: { ecmaFeatures: { jsx: true } },
plugins: ['react', 'react-hooks', 'jsx-a11y'],
rules:{
rules: {
'jsx-quotes': ['error', 'prefer-double'],
'react/jsx-boolean-value': ['error', 'never', { always: [] }],
'react/jsx-pascal-case': ['error', {
allowAllCaps: true,
ignore: [],
}],
'react/jsx-pascal-case': [
'error',
{
allowAllCaps: true,
ignore: [],
},
],
'react/no-string-refs': 'error',
'react/no-unknown-property': 'error',
'react/jsx-key': ['error', {
checkFragmentShorthand: true,
checkKeyMustBeforeSpread: true,
}],
'react/jsx-curly-spacing': ['error', { when: 'never', children: { when: 'always' }, }],
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx', '.tsx'] }],
'react/jsx-key': [
'error',
{
checkFragmentShorthand: true,
checkKeyMustBeforeSpread: true,
},
],
'react/jsx-curly-spacing': [
'error',
{ when: 'never', children: { when: 'always' } },
],
'react/jsx-filename-extension': [
'warn',
{ extensions: ['.js', '.jsx', '.tsx'] },
],
'react/jsx-no-constructed-context-values': 'error',
'react/no-find-dom-node': 'warn',
'react/self-closing-comp': 'error',
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
},
Expand Down

0 comments on commit ffd0ab6

Please sign in to comment.