@cutting/eslint-config 4.38.0 → 4.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cutting/eslint-config",
|
|
3
|
-
"version": "4.38.
|
|
3
|
+
"version": "4.38.1",
|
|
4
4
|
"description": "Cutting eslint configuration definition",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,5 +52,6 @@
|
|
|
52
52
|
},
|
|
53
53
|
"volta": {
|
|
54
54
|
"extends": "../../package.json"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
55
|
+
},
|
|
56
|
+
"readme": "# Cutting eslint-config\r\n\r\nThis package centralises eslint rules to a common package that can be consumed by other packages.\r\n\r\n## Intstallation\r\n\r\nImport this library:\r\n\r\n```bash\r\npnpm add @cutting/eslint-config -S\r\n```\r\n\r\nCreate a `.eslintrc.json` in the root of the project that will consume this library.\r\n\r\nThe bare minimum that is required for a consuming package's `.eslintrc.json` is:\r\n\r\n```json\r\n{\r\n \"extends\": [\"@cutting/eslint-config/react\"]\r\n}\r\n```\r\n\r\n### Packages.json scripts\r\n\r\nAdd the following lines to your package.json to enable linting and prettier to run on files without extensions:\r\n\r\n```bash\r\n \"scripts\": {\r\n \"lint\": \"eslint 'src/**/*.{ts,tsx}'\",\r\n \"lint:fix\": \"pnpm run lint -- --fix\"\r\n }\r\n```\r\n\r\n## VS Code extensions\r\n\r\nESLint\r\n\r\nAfter installing the extension, we need to change some settings of VSCode under: File > Preferences > Settings . Here we want to go to the JSON view of our settings in the top right corner there is a Button with {} on it. Here we need to add this config 👇:\r\n\r\n```json\r\n\"eslint.validate\": [\r\n \"javascript\",\r\n \"javascriptreact\",\r\n {\r\n \"language\": \"typescript\",\r\n \"autoFix\": true\r\n },\r\n {\r\n \"language\": \"typescriptreact\",\r\n \"autoFix\": true\r\n }\r\n]\r\n```\r\n## What rules are applied\r\n\r\nThe following sets of rules are implemented in this package:\r\n\r\n## Typescript\r\n\r\n@typescript-eslint/recommended (rules)\r\n\r\n**React**\r\nAll typescript rules, plus (in order):\r\n\r\neslint-plugin-react/recommended (rules)\r\neslint-plugin-jsx-a11y (rules)\r\neslint-plugin-react-hooks (rules set manually)\r\neslint-plugin-jest (rules)\r\neslint-plugin-import (rules)\r\neslint-config-prettier (rules)\r\neslint-config-prettier/@typescript-eslint\r\neslint-plugin-jest-formatting (rules)\r\nOverrides\r\nSome rules are overriden. Please see `.eslintrc.json` in the package.\r\n\r\n## Overrides\r\n\r\nRules can be overriden in the consuming project's `.eslintrc.json`, or you can disable rules in the files rule by adding the following types of comment\r\n\r\n```javascript\r\n/* eslint-disable: <rule> */\r\n\r\n//eslint-disable-next-line <rule>\r\n```\r\n"
|
|
57
|
+
}
|