Skip to content

Commit

Permalink
feat!: update configuration - add more rules & plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
abelflopes committed Feb 5, 2024
1 parent 6ac27bd commit e162a98
Show file tree
Hide file tree
Showing 18 changed files with 968 additions and 470 deletions.
1 change: 1 addition & 0 deletions .eslintcache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.snapshot.test.ts":"1","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.unit.test.ts":"2","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/index.ts":"3","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-base.ts":"4","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-react.ts":"5","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-testing.ts":"6","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-typescript.ts":"7","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/jest.config.ts":"8"},{"size":170,"mtime":1707097005292,"results":"9","hashOfConfig":"10"},{"size":1049,"mtime":1707097482072,"results":"11","hashOfConfig":"10"},{"size":2102,"mtime":1707096715802,"results":"12","hashOfConfig":"10"},{"size":6165,"mtime":1707096822908,"results":"13","hashOfConfig":"10"},{"size":2978,"mtime":1707095421992,"results":"14","hashOfConfig":"10"},{"size":1362,"mtime":1707095346500,"results":"15","hashOfConfig":"10"},{"size":4412,"mtime":1707097531015,"results":"16","hashOfConfig":"10"},{"size":116,"mtime":1707097206664,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","suppressedMessages":"20","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"u7ble2",{"filePath":"21","messages":"22","suppressedMessages":"23","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"24","messages":"25","suppressedMessages":"26","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"27","messages":"28","suppressedMessages":"29","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"30","messages":"31","suppressedMessages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","suppressedMessages":"35","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","suppressedMessages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","suppressedMessages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.snapshot.test.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.unit.test.ts",["42","43"],["44"],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/index.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-base.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-react.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-testing.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-typescript.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/jest.config.ts",[],[],{"ruleId":"45","severity":2,"message":"46","line":26,"column":7,"nodeType":"47","messageId":"48","endLine":26,"endColumn":18,"suggestions":"49"},{"ruleId":"45","severity":2,"message":"46","line":27,"column":7,"nodeType":"47","messageId":"48","endLine":27,"endColumn":18,"suggestions":"50"},{"ruleId":"51","severity":2,"message":"52","line":8,"column":7,"nodeType":"53","messageId":"54","endLine":11,"endColumn":10,"suppressions":"55"},"no-console","Unexpected console statement.","MemberExpression","unexpected",["56"],["57"],"no-new","Do not use 'new' for side effects.","ExpressionStatement","noNewStatement",["58"],{"messageId":"59","data":"60","fix":"61","desc":"62"},{"messageId":"59","data":"63","fix":"64","desc":"62"},{"kind":"65","justification":"66"},"removeConsole",{"propertyName":"67"},{"range":"68","text":"69"},"Remove the console.log().",{"propertyName":"67"},{"range":"70","text":"69"},"directive","in this case its necessary for testing","log",[622,639],"",[646,697]]
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<br />

Professional grade eslint configuration targeted for typescript & react projects
Professional grade Eslint configuration targeted for typescript & react projects

</div>

Expand All @@ -26,6 +26,26 @@ and includes environment settings for browser, Node.js, and ECMAScript 2021.

This package aims to streamline your development workflow by maintaining code quality and ensuring a consistent coding style across your projects.

It makes use of the recommended settings of each plugin, and extends with extra configuration not present on the recommended preset.

Used plugins / configs:
- [x] [Eslint](https://eslint.org/docs/latest/rules/)
- [x] [Typescript (Eslint)](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
- [x] [Workspaces](https://www.npmjs.com/package/eslint-plugin-workspaces)
- [x] [TSDoc](https://www.npmjs.com/package/eslint-plugin-tsdoc)
- [x] [React](https://www.npmjs.com/package/eslint-plugin-react)
- [x] [React Hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
- [x] [React Refresh](https://www.npmjs.com/package/eslint-plugin-react-refresh)
- [x] [Imports](https://www.npmjs.com/package/eslint-plugin-import)
- [ ] [Import Helpers](https://www.npmjs.com/package/eslint-plugin-import-helpers)
- [x] [Prettier](https://www.npmjs.com/package/eslint-plugin-prettier)
- [ ] [Unicorn (TODO)](https://www.npmjs.com/package/eslint-plugin-unicorn)
- [x] [Etc](https://www.npmjs.com/package/eslint-plugin-etc)
- [x] [Jest](https://www.npmjs.com/package/eslint-plugin-jest)
- [x] [jsx-a11y](https://www.npmjs.com/package/eslint-plugin-jsx-a11y)
- [x] [Eslint Comments](https://www.npmjs.com/package/eslint-plugin-eslint-comments)
- [ ] [Stylistic (TODO)](https://www.npmjs.com/package/@stylistic/eslint-plugin)

To achieve maximum consistency, use along with [prettier-config-pro](https://www.npmjs.com/package/@abelflopes/prettier-config-pro);

## Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Clone this repository, and run `npm install`.
| `npm run build` | compiles into dist |
| `npm run format` | checks for formatting issues | add ` -- --write` to fix formatting automatically |
| `npm run lint` | checks for code issues | add ` -- --fix` to fix issues automatically |
| `npm run test`| runs unit tests | add ` -- --watch` to run in watch mode |
| `npm run test`| runs tests | add ` -- --watch` to run in watch mode |
| `npm run todo`| list all TODO's and FIXME's |
| `npm run clean`| clean temporary and dependency folders |
7 changes: 7 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Config } from "jest";

const config: Config = {
testEnvironment: "node",
};

export default config;
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"test": "npm run test:unit && npm run test:snapshot",
"test:unit": "jest --testPathPattern=\".unit.*\"",
"test:snapshot": "jest --testPathPattern=\".snapshot.*\"",
"test:snapshot:update": "npm run test:snapshot -- -u",
"format": "prettier . --check --cache --ignore-unknown",
"lint": "eslint . --ext ts --cache",
"todo": "npx leasot '**/**' '.**/**' -i '**/node_modules/**' -S -x",
"clean": "rm -rf dist node_modules"
},
Expand Down Expand Up @@ -55,6 +55,7 @@
"eslint-config-xo": "^0.43.1",
"eslint-config-xo-react": "^0.27.0",
"eslint-config-xo-typescript": "^1.0.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-etc": "^2.0.3",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.4.0",
Expand Down
Loading

0 comments on commit e162a98

Please sign in to comment.