Skip to content

Commit

Permalink
Add docs and update rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Mar 9, 2022
1 parent 37235cf commit c8e2fc5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 30 deletions.
32 changes: 4 additions & 28 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = {
},
],

// typescript-eslint overrides
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/naming-convention': 'off',
Expand All @@ -24,31 +23,17 @@ module.exports = {
'@typescript-eslint/no-redeclare': 'off',
'react/prop-types': 'off',
'react/jsx-no-bind': 'off',

// @mantine/tests require jest exports
'jest/no-export': 'off',

// This looks very messy in editor
'jest/expect-expect': 'off',

// sometimes it is better
'react/function-component-definition': 'off',
'react/jsx-no-constructed-context-values': 'off',
'react/no-unstable-nested-components': 'off',
'react/jsx-no-useless-fragment': 'off',
'no-nested-ternary': 'off',

// Usually default case is not required
'default-case': 'off',

// controlled with prettier
'arrow-parens': 'off',
'function-paren-newline': 'off',
'react/jsx-curly-newline': 'off',

// disabled for condition && someFunc()
'no-unused-expressions': 'off',

// backend developers like _, no need to transform data all the time
camelcase: 'off',

// just the formatting issues, prettier does all the job
'react/jsx-indent': 'off',
'react/jsx-wrap-multilines': 'off',
'no-confusing-arrow': 'off',
Expand All @@ -67,7 +52,6 @@ module.exports = {
},
],

// these are totally useless
'no-underscore-dangle': 'off',
'class-methods-use-this': 'off',
'react/state-in-constructor': 'off',
Expand All @@ -81,18 +65,10 @@ module.exports = {
'jsx-a11y/control-has-associated-label': 'off',
'jsx-a11y/mouse-events-have-key-events': 'off',
'import/prefer-default-export': 'off',

// sometimes there is no alternative
'react/no-array-index-key': 'off',

// does not matter for monorepo
'import/no-extraneous-dependencies': 'off',

// rules are broken and provide falsy mistakes
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/anchor-is-valid': 'off',

// it does not spoil anything if used wisely
'jsx-a11y/no-autofocus': 'off',
},
};
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# eslint-config-mantine

Mantine ESLint configuration
## Install

```sh
npx install-peerdeps eslint-config-mantine
```

## Usage

In your `.eslintrc.js`:

```tsx
module.exports = {
extends: ['mantine'],
parserOptions: {
project: './tsconfig.json',
},
};
```

## License

MIT
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-mantine",
"version": "1.0.0",
"version": "1.1.0",
"main": ".eslintrc.js",
"license": "MIT",
"author": "Vitaly Rtishchev <[email protected]>",
Expand Down

0 comments on commit c8e2fc5

Please sign in to comment.