Skip to content

Commit

Permalink
chore(ops): add standard-linter (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanosync authored Nov 1, 2023
1 parent 9f4adda commit 58630cb
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/standard-linter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
Linter
---

`@ordzaar/standard-linter`

Standard linter for TS projects that do not run with web frameworks. This module also installs `prettier`, `eslint`, `husky` and `lint-staged`.

Lint rules are extended from these packages

| Package | Description |
| -------------------------------- | ----------------------------------------------------- |
| @typescript-eslint/parser | Rules parser for TypeScript. |
| eslint-config-airbnb-base | Rules defined by airbnb. |
| eslint-config-airbnb-typescript | Rules defined by airbnb for TypeScript without React. |
| eslint-plugin-simple-import-sort | Rules defined for simple import sorting. |
| prettier | Rules defined by prettier to have same code styles |
34 changes: 34 additions & 0 deletions packages/standard-linter/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"airbnb",
"airbnb-typescript/base",
"prettier",
],
plugins: ["simple-import-sort", "prettier"],
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"sort-imports": "off",
"import/order": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
},
overrides: [
{
files: ["**/**.{test,spec,unit}.{js,ts}"],
rules: {
"@typescript-eslint/no-floating-promises": "off",
},
},
],
};
22 changes: 22 additions & 0 deletions packages/standard-linter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "@ordzaar/standard-linter",
"version": "0.0.0",
"main": "index.js",
"files": [
"index.js"
],
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"eslint": "^8.52.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"husky": "^8.0.3",
"lint-staged": "^15.0.2",
"prettier": "^3.0.3",
"typescript": "^5.2.2"
}
}
4 changes: 4 additions & 0 deletions packages/standard-web-linter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ module.exports = {
curly: ["error", "all"],
"object-curly-spacing": ["error", "always"],
"nonblock-statement-body-position": ["error", "below"],
"sort-imports": "off",
"import/order": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
},
};
39 changes: 39 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 58630cb

Please sign in to comment.