Skip to content

Commit adc20fc

Browse files
authored
feat: add course codely config (#11)
1 parent d78942d commit adc20fc

4 files changed

Lines changed: 60 additions & 12 deletions

File tree

README.md

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@
2828
## 👀 How to use
2929

3030
1. Install the dependency.
31+
3132
```bash
3233
npm install --save-dev eslint-config-codely
3334
```
35+
3436
2. Add it to your `eslint.config.js`:
3537

3638
```js
@@ -47,33 +49,67 @@ export default [
4749
]
4850
```
4951

52+
Also, you can use the `full` config, which includes the `js`, `ts` and very opinionated Codely configs.
53+
54+
```js
55+
import eslintConfigCodely from "eslint-config-codely";
56+
57+
export default [
58+
...eslintConfigCodely.full,
59+
{
60+
// Your config here
61+
}
62+
]
63+
```
64+
65+
We have a `course` setting. This is the same as the `full` config, but with a narrower width due to the zoom used in
66+
videos:
67+
68+
```js
69+
import eslintConfigCodely from "eslint-config-codely";
70+
71+
export default [
72+
...eslintConfigCodely.course,
73+
{
74+
// Your config here
75+
}
76+
]
77+
```
78+
5079
ℹ️ Please note that some of the rules enabled by default require that you have `strict: true` in your `tsconfig.json`.
5180

5281
## 🤔 What it does
5382

54-
- Lints JavaScript using [`eslint:recommended`](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#using-eslintrecommended) and [Prettier](https://prettier.io/).
55-
- Additionally, lints TypeScript using [`@typescript-eslint/recommended` and `@typescript-eslint/recommended-requiring-type-checking`](https://typescript-eslint.io/docs/linting/configs).
83+
- Lints JavaScript using [
84+
`eslint:recommended`](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#using-eslintrecommended)
85+
and [Prettier](https://prettier.io/).
86+
- Additionally, lints TypeScript using [`@typescript-eslint/recommended` and
87+
`@typescript-eslint/recommended-requiring-type-checking`](https://typescript-eslint.io/docs/linting/configs).
5688
- Uses the following plugins:
57-
- [`import`](https://github.com/import-js/eslint-plugin-import/): helps validate proper imports.
58-
- [`simple-import-sort`](https://github.com/lydell/eslint-plugin-simple-import-sort/): sorts imports.
59-
- [`unused-imports`](https://github.com/sweepline/eslint-plugin-unused-imports): finds and removes unused ES6 module imports.
89+
- [`import`](https://github.com/import-js/eslint-plugin-import/): helps validate proper imports.
90+
- [`simple-import-sort`](https://github.com/lydell/eslint-plugin-simple-import-sort/): sorts imports.
91+
- [`unused-imports`](https://github.com/sweepline/eslint-plugin-unused-imports): finds and removes unused ES6 module
92+
imports.
6093
- Uses rules inside the [configs](configs) folder.
6194

6295
## 👌 Codely Code Quality Standards
6396

6497
Publishing this package we are committing ourselves to the following code quality standards:
6598

6699
- 🤝 Respect **Semantic Versioning**: No breaking changes in patch or minor versions.
67-
- 🤏 No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose.
68-
- 🎯 **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities.
69-
- **Tests** as documentation and usage examples.
100+
- 🤏 No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose.
101+
- 🎯 **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities.
102+
- **Tests** as documentation and usage examples.
70103
- 📖 **Well documented ReadMe** showing how to install and use.
71104
- ⚖️ **License favoring Open Source** and collaboration.
72105

73106
## 🔀 Related resources
74107

75-
- [🔦 Linting en JavaScript y TypeScript](https://pro.codely.com/library/linting-en-javascript-y-typescript-188432/446893/about/): Used as a template to bootstrap this plugin.
76-
- [🎯 Codely's ESLint Hexagonal Architecture plugin](https://github.com/CodelyTV/eslint-plugin-hexagonal-architecture): A plugin that helps you to enforce hexagonal architecture best practises. Valid for your JavaScript or TypeScript projects.
108+
- [🔦 Linting en JavaScript y TypeScript](https://pro.codely.com/library/linting-en-javascript-y-typescript-188432/446893/about/):
109+
Used as a template to bootstrap this plugin.
110+
- [🎯 Codely's ESLint Hexagonal Architecture plugin](https://github.com/CodelyTV/eslint-plugin-hexagonal-architecture): A
111+
plugin that helps you to enforce hexagonal architecture best practises. Valid for your JavaScript or TypeScript
112+
projects.
77113

78114
Opinionated skeletons ready for different purposes:
79115

configs/codely-course.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import eslintPluginCodely from "./codely-full.js";
2+
3+
export default [
4+
...eslintPluginCodely,
5+
{
6+
rules: {
7+
"prettier/prettier": ["error", { printWidth: 80, useTabs: true, tabWidth: 4 }],
8+
},
9+
},
10+
];

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import courseConfig from "./configs/codely-course.js";
12
import fullConfig from "./configs/codely-full.js";
23
import jsConfig from "./configs/codely-js.js";
34
import tsConfig from "./configs/codely-ts.js";
45

56
const eslintConfigCodely = {
7+
course: courseConfig,
8+
full: fullConfig,
69
js: jsConfig,
710
ts: tsConfig,
8-
full: fullConfig,
911
};
1012

1113
export default eslintConfigCodely;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-codely",
3-
"version": "4.1.0",
3+
"version": "4.2.0",
44
"description": "Codely's ESLint and Prettier Config",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)