You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-16
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Javascript Style Guide
2
2
3
-
This project is a code style guide of all basic back- and front end project used at Anolilab.
3
+
This project is a shareable code style guide of all basic back- and front end project used at Anolilab.
4
4
5
5
---
6
6
@@ -14,28 +14,45 @@ This project is a code style guide of all basic back- and front end project used
14
14
15
15
---
16
16
17
-
## Packages:
17
+
This is a mono-repository that contains a collection of separate, shareable npm packages that provide various configuration files for commonly used tools in modern web development.
|[babel](https://github.com/babel/babel)|[babel-preset](https://github.com/anolilab/javascript-style-guide/blob/main/packages/babel-preset/README.md)|| Babel is a JavaScript compiler to use next generation JavaScript, today |
29
+
|[browserslist](https://github.com/browserslist/browserslist)|[browserslist-config](https://github.com/anolilab/javascript-style-guide/blob/main/packages/browserslist-config-anolilab/README.md)|| Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-preset-env |
30
+
|[eslint](https://eslint.org)|[eslint-config](https://github.com/anolilab/javascript-style-guide/blob/main/packages/eslint-config/README.md)|| Statically analyzes your code to quickly find problems. |
31
+
| - |[package-json-utils](https://github.com/anolilab/javascript-style-guide/blob/main/packages/package-json-utils/README.md)|| Shared utilities for parsing information from a package.json file. |
32
+
|[lint-staged](https://github.com/okonet/lint-staged)|[lint-staged-config](https://github.com/anolilab/javascript-style-guide/blob/main/packages/lint-staged-config/README.md)|| Run linters on git staged files. |
33
+
|[postcss](https://postcss.org)|[postcss-config](https://github.com/anolilab/javascript-style-guide/blob/main/packages/postcss-config/README.md)|| Add vendor prefixes to CSS rules using values from [Can I Use](https://caniuse.com). |
34
+
|[prettier](https://github.com/prettier/prettier)|[prettier-config](https://github.com/anolilab/javascript-style-guide/blob/main/packages/prettier-config/README.md)|| Prettier is an opinionated code formatter. |
35
+
|[semantic-release](https://github.com/semantic-release/semantic-release) </br></br> [commitlint](https://commitlint.js.org)|[semantic-release-preset](https://github.com/anolilab/javascript-style-guide/blob/main/packages/semantic-release-preset/README.md)|| semantic-release is a fully automated version management and package publishing library </br></br> Helps your team adhere to a commit convention. |
36
+
|[secretlint](https://github.com/secretlint/secretlint)|[secretlint-config](https://github.com/anolilab/javascript-style-guide/blob/main/packages/secretlint-config/README.md)|| Pluggable linting tool to prevent committing credential |
37
+
|[stylelint](https://stylelint.io)|[stylelint-config](https://github.com/anolilab/javascript-style-guide/blob/main/packages/stylelint-config/README.md)|| Linter that helps you avoid errors and enforce conventions in your styles |
38
+
|[textlint](https://github.com/textlint/textlint)|[textlint-config](https://github.com/anolilab/javascript-style-guide/blob/main/packages/textlint-config/README.md)|| The pluggable natural language linter for text and markdown. |
It helps you maintain consistency across different projects and ensures that your projects support the same set of browsers.
9
8
</div>
10
9
11
10
---
@@ -20,60 +19,46 @@ This configuration reflects Growcss’s supported browser policy for their UI li
20
19
21
20
---
22
21
23
-
## What is Browserslist?
22
+
## Purpose
24
23
25
-
[Browserslist](https://github.com/browserslist/browserslist) is a library to share a browsers list between different front end tools, like Autoprefixer, Eslint, and Stylelint.
24
+
Our package aims to simplify and streamline the configuration process for your projects, ensuring efficiency and minimizing errors. By implementing the following strategies, we achieve this goal:
-["Browserslist is a Good Idea"](https://css-tricks.com/browserlist-good-idea/) (blog post by [@chriscoyier](https://github.com/chriscoyier))
26
+
- Centralized Browser Targeting: Say goodbye to the hassle of defining target browsers for each individual project. Our package eliminates this need, providing a single, consistent configuration.
29
27
30
-
## Supported Browsers
28
+
- Widely Used Target Browsers: We offer a carefully curated selection of popular target browsers. You can rely on our pre-defined set to cover a wide range of user preferences.
31
29
32
-
```js
33
-
{
34
-
"production": [
35
-
"> 1%",
36
-
"last 2 versions",
37
-
"Firefox ESR"
38
-
],
39
-
"legacyBrowsers": [
40
-
"> 1%",
41
-
"last 2 versions",
42
-
"Firefox ESR"
43
-
],
44
-
"modernBrowsers": [
45
-
"last 2 Chrome versions",
46
-
"not Chrome < 60",
47
-
"last 2 Safari versions",
48
-
"not Safari < 10.1",
49
-
"last 2 iOS versions",
50
-
"not iOS < 10.3",
51
-
"last 2 Firefox versions",
52
-
"not Firefox < 54",
53
-
"last 2 Edge versions",
54
-
"not Edge < 15"
55
-
],
56
-
"ssr": [
57
-
"node 12"
58
-
]
59
-
}
60
-
```
30
+
- Effortless Updates: Keeping up with evolving browser requirements is effortless with our package. You can easily update the target browsers across all your projects whenever necessary, saving valuable time and effort.
31
+
32
+
In summary, our Browserslist Config ensures a superior user experience across various browsers, making it a vital tool for maintaining high-quality standards. Your users will enjoy a seamless browsing experience, regardless of their chosen platform.
61
33
62
34
## Installation
63
35
64
-
Install the module
36
+
Install the package using your preferred package manager:
Optionally, you can install `browserslist` to use the `browserslist` CLI.
51
+
52
+
Adding the following script to your root package.json file makes it easier to run the browserslist command in your mono-repository:
53
+
54
+
```bash
55
+
pnpm pkg set scripts.lint:browsers="browserslist"
75
56
```
76
57
58
+
For `npm` users, replace `pnpm` with npm in the above command.
59
+
60
+
This script allows you to run the `browserslist` command by simply typing `pnpm run lint:browsers` (or `npm run lint:browsers` for npm users) in the terminal.
61
+
77
62
## Usage
78
63
79
64
### Package.json
@@ -107,6 +92,45 @@ Or when using [babel-preset-env](https://github.com/babel/babel/tree/master/expe
107
92
}
108
93
```
109
94
95
+
## What is Browserslist?
96
+
97
+
[Browserslist](https://github.com/browserslist/browserslist) is a library to share a browsers list between different front end tools, like Autoprefixer, Eslint, and Stylelint.
0 commit comments