From c8e2fc5929d9dc49aabd00517454f1ba5a85b04a Mon Sep 17 00:00:00 2001 From: Vitaly Rtishchev Date: Wed, 9 Mar 2022 22:35:36 +0300 Subject: [PATCH] Add docs and update rules --- .eslintrc.js | 32 ++++---------------------------- README.md | 23 ++++++++++++++++++++++- package.json | 2 +- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 003b5dd..cfcda6d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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', @@ -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', @@ -67,7 +52,6 @@ module.exports = { }, ], - // these are totally useless 'no-underscore-dangle': 'off', 'class-methods-use-this': 'off', 'react/state-in-constructor': 'off', @@ -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', }, }; diff --git a/README.md b/README.md index bf808aa..a635228 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index 875f802..db507ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-mantine", - "version": "1.0.0", + "version": "1.1.0", "main": ".eslintrc.js", "license": "MIT", "author": "Vitaly Rtishchev ",