-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: kickoff repo #1
Conversation
package.json
Outdated
}, | ||
"devDependencies": { | ||
"eslint": "^9.11.1", | ||
"jiti": "^2.1.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need jiti ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://eslint.org/docs/latest/use/configure/configuration-files#typescript-configuration-files
It is to be able to use a TS config file for ESLint eslint.config.ts
. With it, the same index config we will export, is also used to lint the project itself.
@@ -0,0 +1,51 @@ | |||
{ | |||
"name": "@empathyco/eslint-config", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢 Horrible name
eslint but has prettier config, deps, node-npm version, typescript config...
my suggestion: frontend-config
looks better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nono, the main goal for now is using this repo as linter and formatter. The rest of files remains in the repo
As we discussed, for the time being it is not a boilerplate repo
README.md
Outdated
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"lint:inspect": "eslint . --inspect-config", | ||
"prettier": "prettier --write ." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost all Motive fronted project has:
"lint": "eslint .", | |
"lint:fix": "eslint . --fix", | |
"lint:inspect": "eslint . --inspect-config", | |
"prettier": "prettier --write ." | |
"format": "prettier --write .", | |
"format-check": "prettier --check .", | |
"lint": "eslint . --fix", | |
"lint-check": "eslint ." |
why format
and not prettier
?
We should not stick to a tool name, in the future we could use another tool like Biome.
That is why we have lint
and not eslint
.
Check vs Fix
There are 2 options,
- The short version
lint
only does checks and a long versionlint:fix
that fixes the issues. - short version
lint
fixes and long versionlint-check
checks.
My proposal is, the short and quick/easy to write version, which is the one we usually use as developer, I would say with the fix included.
That is why I prefer option 2.
Also match with other scripts like typecheck
or type-check
"lint:inspect": "eslint . --inspect-config",
It is useful, but only occasionally, I think it will not be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with format
instead of prettier
.
I also refactored the script as you suggested, but with lint:check
or format:check
because it is as we use the scripts in every project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"every project" → some
src/index.ts
Outdated
typescript: { | ||
tsconfigPath: 'tsconfig.json' | ||
}, | ||
ignores: ['.loaded_actions', '*.d.ts'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why '*.d.ts'
?? they could also have imports that will be sorted, and other rules also applies to them, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I picked it from the x project and I think it is something custom for the repo than the general eslint config.
Consider it removed.
printWidth: 100, | ||
singleQuote: true, | ||
arrowParens: 'avoid', | ||
trailingComma: 'none', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be discussed:
Common scenario:
With trailingComma: 'none',
:
const x = {
- a: 3
+ a: 3,
+ b: 4
}
vs trailingComma: 'all',
(the default)
const x = {
a: 3,
+ b: 4,
}
singleQuote: true, | ||
arrowParens: 'avoid', | ||
trailingComma: 'none', | ||
vueIndentScriptAndStyle: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also,
I vote for false
(the default)
In some projects will create a one time commit to format all files. thats all
we win:
- keep with defaults
- 2 more chars
cons
- 1 time commit with changes, after several months it is forgotten.
WIP