Skip to content

Commit

Permalink
Style(repo): Rewrite documentation using Textlint ruleset
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Jan 16, 2023
1 parent 1e339db commit 22e19bd
Show file tree
Hide file tree
Showing 22 changed files with 103 additions and 79 deletions.
20 changes: 18 additions & 2 deletions .textlintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
module.exports = {
rules: {
'@lmc-eu/textlint-rule-preset-lmc': true,
'@lmc-eu/textlint-rule-preset-lmc': {
'title-case': {
headingLevels: [6],
exclude: [
'@lmc-eu',
'@lmc-eu/stylelint-config',
'@lmc-eu/eslint-config-react',
'@lmc-eu/eslint-config-react/optional',
'@lmc-eu/eslint-config-base',
'@lmc-eu/eslint-config-base/optional',
'@lmc-eu/eslint-config-base/legacy',
'@lmc-eu/eslint-config-base/whitespace',
'@lmc-eu/commitlint-config',
'@lmc-eu/textlint-rule-preset-lmc',
],
},
},
},
}
};
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Contributing to `code-quality-tools`

First of all, thanks for your contribution to this project! ❤️ Here are some tips how to make your contributing efforts efficient and eventually accepted & merged.
First, thanks for your contribution to this project! ❤️ Here are some tips how to make your contributing efforts efficient and eventually accepted & merged.

## General usage

This project uses `Makefile` for managing various chores, like dependency installation, testing, linting etc. Make sure you run `make` right after you clone the repository - it will set you up with everything needed to get started. Once you are done with that, have a look at what commands (targets) are available for you to run using `make` - `make install`, `make lint` etc.

## Commit messages

All commits you make should adhere to our commit guidelines. We use [conventional commits][conventional-commits] strategy with our [slight modification of used keywords][lmc-conventional-commits]. This is later used during release phase to determine how to bump the packages' version numbers based on commit history. 🚀
All commits you make should adhere to our commit guidelines. We use [conventional commits][conventional-commits] strategy with our [slight modification of used keywords][lmc-conventional-commits]. This is later used during release phase to determine how to bump the packages version numbers based on commit history. 🚀

## Code style

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This monorepo contains shareable configurations for various coding-style/best pr
| ESLint | [@lmc-eu/eslint-config-graphql](packages/eslint-config-graphql) | [![@lmc-eu/eslint-config-graphql][ec-gql-badge]][ec-gql-npm] |
| ESLint | [@lmc-eu/eslint-config-react](packages/eslint-config-react) | [![@lmc-eu/eslint-config-react][ec-react-badge]][ec-react-npm] |
| ESLint | [@lmc-eu/eslint-config-jest](packages/eslint-config-jest) | [![@lmc-eu/eslint-config-jest][ec-jest-badge]][ec-jest-npm] |
| Textlint | [@lmc-eu/textlint-rule-preset-lmc](packages/textlint-rule-preset-lmc) | [![@lmc-eu/textlint-rule-preset-lmc][tlc-badge]][tlc-npm] |
| Textlint | [@lmc-eu/textlint-rule-preset-lmc](packages/textlint-rule-preset-lmc) | [![@lmc-eu/textlint-rule-preset-lmc][tlc-badge]][tlc-npm] |

## License

Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Documentation

Each package has it's own documentation living in it's package folder.
Each package has its own documentation living in its package folder.

Over here you can find more generic stuff which is specific for multiple packages.
Over here you can find more generic stuff specific for multiple packages.
28 changes: 14 additions & 14 deletions docs/eslint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ When configuring ESLint, please keep the following in mind:

- Prefer _.eslintrc.js_ format over YAML/JSON

> JSON cannot contain comments or other simple code, and YAML requires custom parser. Using standard node.js module format speeds the whole linting process up.
> JSON cannot contain comments or other simple code, and YAML requires custom parser. Using standard Node.js module format speeds the whole linting process up.
- Always extend only from **one environment configuration** per _.eslintrc.js_

Expand All @@ -36,40 +36,40 @@ When configuring ESLint, please keep the following in mind:
> For example, the rule `node/no-process-env` is enabled by default because accessing any property on `process.env` object causes an expensive C-level function call. However, using `process.env` is the recommended way to manage application configuration. Therefore, some configuration files disable this rule for all files located in a directory named _config_ or _configuration_. Here, you gather all the required configuration options from `process.env` and export them in a module. The rest of your application no longer needs to access `process.env` directly and instead reads the configuration from that module.
- Always consider re-configuring a rule rather than disabling it completely
> If a rule does not quite fit your exiting codebase and fixing the issues would take considerable amount of time/energy, please consider first if the rule could be re-configured to suit your project's current style, rather than disabling it right away.
> If a rule does not quite fit your exiting codebase and fixing the issues would take considerable amount of time/energy, please consider first if the rule could be re-configured to suit your projects current style, rather than disabling it right away.
## Available rulesets

> Read more in packages readme
### For [Node.js][nodejs-docs]

- @lmc-eu/eslint-config-node/v14
- @lmc-eu/eslint-config-node/v16
- @lmc-eu/eslint-config-node/optional
- @lmc-eu/eslint-config-node/style
- `@lmc-eu/eslint-config-node/v14`
- `@lmc-eu/eslint-config-node/v16`
- `@lmc-eu/eslint-config-node/optional`
- `@lmc-eu/eslint-config-node/style`

### For [React][react-docs]

- @lmc-eu/eslint-config-react
- @lmc-eu/eslint-config-react/optional
- @lmc-eu/eslint-config-react/style
- `@lmc-eu/eslint-config-react`
- `@lmc-eu/eslint-config-react/optional`
- `@lmc-eu/eslint-config-react/style`

### For [React Native][react-native-docs]

- @lmc-eu/eslint-config-react-native
- @lmc-eu/eslint-config-react-native/optional
- @lmc-eu/eslint-config-react-native/style
- `@lmc-eu/eslint-config-react-native`
- `@lmc-eu/eslint-config-react-native/optional`
- `@lmc-eu/eslint-config-react-native/style`

### For [TypeScript][typescript-docs]

> Requires configuration. See the docs for more info.
- @lmc-eu/typescript
- `@lmc-eu/typescript`

### For [Jest][jest-docs]

- @lmc-eu/eslint-config-jest
- `@lmc-eu/eslint-config-jest`

[nodejs-docs]: ../../packages/eslint-config-node
[react-docs]: ../../packages/eslint-config-react
Expand Down
10 changes: 5 additions & 5 deletions docs/eslint/editor-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ Letting your editor fix some issues will increase your productivity and code qua

Install the following packages:

- [eslint][vscode-eslint]
- [ESLint][vscode-eslint]

Put the following configuration options into your _settings.json_ file:

- `"eslint.autoFixOnSave": true`

## PHPStorm/WebStorm

WebStorm has built-in support for ESLint issue reporting. Auto fixing is only supported in versions 2016.3 and newer.
WebStorm has built-in support for ESLint issue reporting. Autofixing is only supported in versions 2016.3 and newer.

To enable ESLint reporter, [follow the guide][webstorm-eslint] on WebStorm's support page.
To enable ESLint reporter, [follow the guide][webstorm-eslint] on WebStorms support page.
To use the new autofix feature, [read their blog post][webstorm-eslint-autofix] on the topic.

To use autofix on save feature:
Expand All @@ -30,10 +30,10 @@ To use autofix on save feature:
1. Click the `Add` (+) button and choose custom template
1. Name it for example `eslint`
1. Set file type to `javascript`
1. Program will be your path to eslint binary for example `/Users/[yourusername]/git/[yourproject]/node_modules/.bin/eslint`
1. Program will be your path to ESLint binary for example `/Users/[yourusername]/git/[yourproject]/node_modules/.bin/eslint`
1. Arguments `--fix $FilePath$`
1. Working directory `$ProjectFileDir$`
1. Show console `never` (if you don't want to see the console when `--fix` command finds errors)
1. Show console `never` (if you dont want to see the console when `--fix` command finds errors)
1. Check `Trigger watcher regardless of syntax errors` and uncheck `Immediate file synchronization`

## Atom
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@
"packages:changed": "lerna changed",
"packages:list": "lerna ls",
"packages:test": "lerna run test",
"test": "npm-run-all --serial lint:* packages:test format",
"test": "npm-run-all --serial lint packages:test format",
"commit:lint:test": "commitlint --from HEAD~1 --to HEAD --verbose",
"format": "yarn format:check",
"format:check": "prettier --check ./",
"format:fix": "prettier --write ./",
"format:fix:changelog": "prettier --write ./packages/**/CHANGELOG.md",
"lint": "eslint ./",
"lint:fix": "yarn lint --fix",
"lint": "npm-run-all --serial lint:es lint:text",
"lint:fix": "npm-run-all --serial lint:*:fix",
"lint:es": "eslint ./",
"lint:es:fix": "yarn lint:es --fix",
"lint:text": "textlint ./",
"lint:text:fix": "yarn textlint --fix",
"lint:text:fix": "yarn lint:text --fix",
"version": "yarn format:fix:changelog"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/browserslist-config/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `@lmc-eu/browserslist-config`

> LMC's config for Browserslist
> LMCs config for Browserslist
## Installation

Expand Down Expand Up @@ -30,7 +30,7 @@ Alternatively, add this to your `package.json` file:

### Extending

If you need to support IE (or any other browser):
To support Internet Explorer (or any other browser):

```
extends @lmc-eu/browserslist-config
Expand Down Expand Up @@ -61,7 +61,7 @@ your `.browserslistrc` (or `package.json`, wherever you store your config):
- …
```

Refer to the stats file in your Browserslist configuration:
As mentioned in the stats file in your Browserslist configuration:

```
extends @lmc-eu/browserslist-config
Expand Down
2 changes: 1 addition & 1 deletion packages/commitlint-config/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @lmc-eu/commitlint-config

> LMC's config for commitlint
> LMCs config for commitlint
## Configurations

Expand Down
2 changes: 1 addition & 1 deletion packages/conventional-changelog-lmc-bitbucket/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @lmc-eu/conventional-changelog-lmc-bitbucket

> LMC's Conventional Changelog preset for BitBucket repositories
> LMCs Conventional Changelog preset for BitBucket repositories
## Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/conventional-changelog-lmc-github/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @lmc-eu/conventional-changelog-lmc-github

> LMC's Conventional Changelog preset for GitHub repositories
> LMCs Conventional Changelog preset for GitHub repositories
## Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/conventional-changelog-lmc/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @lmc-eu/conventional-changelog-lmc

> LMC's Conventional Changelog Writer and Parser
> LMCs Conventional Changelog Writer and Parser
## Installation

Expand Down
12 changes: 6 additions & 6 deletions packages/eslint-config-base/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @lmc-eu/eslint-config-base

## Shared rules
## Shared Rules

These rules are meant to be shared across all ESLint rulesets.

Expand All @@ -12,11 +12,11 @@ These rules are meant to be shared across all ESLint rulesets.

### `@lmc-eu/eslint-config-base`

Use this ruleset to configure ESLint to work with every Javascript code.
Use this ruleset to configure ESLint to work with every JavaScript code.

### `@lmc-eu/eslint-config-base/optional`

Use this ruleset in conjunction with the above ruleset. Provides additional insights into potential inconsistencies in the project.
Use this ruleset together with the above ruleset. Provides additional insights into potential inconsistencies in the project.

> For new projects, it is recommended to enable this ruleset. For existing projects, it is only recommended for the brave.
Expand All @@ -28,7 +28,7 @@ Lints ES5 and below.

This entry point only errors on whitespace rules and sets all other rules to warnings. View [the list of whitespace rules](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/whitespace.js).

## Recommended ESLint config
## Recommended ESLint Configuration

```js
// .eslintrc.js
Expand Down Expand Up @@ -62,8 +62,8 @@ module.exports = {
}
```

It is also recommended that you lint the whole project folder (ie. `npx eslint .`) instead of just
some folders (ie. `npx eslint src test`) and create an _.eslintignore_ file excluding any unwanted
It is also recommended that you lint the whole project folder (that is `npx eslint .`) instead of just
some folders (that is. `npx eslint src test`) and create an _.eslintignore_ file excluding any unwanted
lint folders. Doing so will allow new directories to be created without worrying about having to update your
tools to lint the new directory.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {

The shareable config can be customized in your [**eslint** configuration file](https://eslint.org/docs/user-guide/configuring).

Additionally don't forget to have `.graphqlconfig` file:
Additionally dont forget to have `.graphqlconfig` file:

```json
{
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-jest/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @lmc-eu/eslint-config-jest

> LMC's ESLint config for projects using Jest as test runner
> LMCs ESLint config for projects using Jest as test runner
These configuration files are suitable to lint Jest test files.

Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-config-react/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @lmc-eu/eslint-config-react

> LMC's ESLint configuration for React projects
> LMCs ESLint configuration for React projects
## Installation

Expand All @@ -20,11 +20,11 @@ Use this ruleset to configure ESLint to work with React code.

### `@lmc-eu/eslint-config-react/optional`

Use this ruleset in conjunction with the above ruleset. Provides additional insights into potential inconsistencies in the project.
Use this ruleset together with the above ruleset. Provides additional insights into potential inconsistencies in the project.

> For new projects, it is recommended to enable this ruleset. For existing projects, it is only recommended for the brave.
## Recommended ESLint config
## Recommended ESLint Configuration

```js
// .eslintrc.js
Expand Down Expand Up @@ -60,8 +60,8 @@ module.exports = {

</details>

It is also recommended that you lint the whole project folder (ie. `npx eslint .`) instead of just
some folders (ie. `npx eslint src test`) and create an _.eslintignore_ file excluding any unwanted
It is also recommended that you lint the whole project folder (that is. `npx eslint .`) instead of just
some folders (that is. `npx eslint src test`) and create an _.eslintignore_ file excluding any unwanted
lint folders. Doing so will allow new directories to be created without worrying about having to update your
tools to lint the new directory.

Expand Down
6 changes: 3 additions & 3 deletions packages/prettier-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ And reference it in your _.prettierrc.js_ file:
module.exports = require('@lmc-eu/prettier-config');
```

Or you can of course choose your preffered way of using configs:
Or you can choose your preffered way of using configs:

<details>
<summary><i>package.json</i></summary>
Expand Down Expand Up @@ -57,9 +57,9 @@ module.exports = {

## Notes

### Prettier version
### Prettier Version

Versions of `prettier` prior to v1.17 did not feature the possibility to use a shared config via _package.json_. The way to do it is similar to when [extending](#Extending), except that you can just export the config directly:
Versions of `prettier` before v1.17 did not feature the possibility to use a shared config via _package.json_. The way to do it is similar to when [extending](#Extending), except that you can just export the config directly:

```js
// .prettierrc.js
Expand Down
6 changes: 3 additions & 3 deletions packages/renovate-config/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# `@lmc-eu/renovate-config`

> LMC's config for renovate
> LMCs config for renovate
## Usage

Enable Renovate in your repo and just `extends` in `renovate.json`.
Enable Renovate in your repository and just `extends` in `renovate.json`.

```json
{
"extends": ["@lmc-eu"]
}
```

Note: You don't have to do `npm i -D @lmc-eu/renovate-config`.
Note: You dont have to do `npm i -D @lmc-eu/renovate-config`.

## Presets

Expand Down
Loading

0 comments on commit 22e19bd

Please sign in to comment.