Skip to content

Commit

Permalink
Added commonjs, jsdoc rules. Split node into node and mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
vsulak committed Nov 5, 2022
1 parent 7e9678e commit a0bf51e
Show file tree
Hide file tree
Showing 19 changed files with 1,880 additions and 682 deletions.
12 changes: 9 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"parserOptions": {
"ecmaVersion": "latest"
},
"env": {
"node": true
"es2019": true,
"node": true,
"mocha": true
},
"extends": [
"eslint:recommended"
],
"rules": {
"array-element-newline": ["error", "consistent"],
"comma-dangle": ["error", "always-multiline"],
"indent": ["error", 2],
"quotes": ["error", "single"],
"array-element-newline": ["error", "always"]
"quotes": ["error", "single"]
}
}
19 changes: 14 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# CHANGELOG

## 16.0.0 (2022-11-05)

- Added `commonjs` rule set with
- Added `jsdoc` rule set with
- Added some tests
- Split `node` rule set into `node` and `mocha`
- Updated dependencies
- Updated target compatibility towards `ES2019`

## 15.0.0 (2022-08-26)

- Updated dependencies
- Compatibility towards xo@0.52.2
- Compatibility towards `xo@0.52.2`
- Switched `eslint-plugin-node` for `eslint-plugin-n`

## 14.0.0 (2022-04-07)

- Updated dependencies
- Compatibility towards xo@0.48.0
- Compatibility towards `xo@0.48.0`

## 13.1.0 (2022-01-14)

Expand All @@ -22,18 +31,18 @@
## 12.0.0 (2021-12-10)

- Updated dependencies
- Compatibility towards xo@0.47.0
- Compatibility towards `xo@0.47.0`

## 11.0.0 (2021-08-12)

- ESM modules allowed by default
- Updated dependencies
- Compatibility towards xo@0.44.0
- Compatibility towards `xo@0.44.0`

## 10.0.0 (2021-07-12)

- Updated dependencies
- Compatibility towards xo@0.41.0
- Compatibility towards `xo@0.41.0`

## 9.0.0 (2021-05-27)

Expand Down
53 changes: 43 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,81 @@ npm install --save-dev eslint-config-touch4it

## Usage

Built for ES2019+

Add some ESLint config to your `package.json`:

```json
{
"name": "my-awesome-project",
"eslintConfig": {
"extends": "touch4it"
}
"name": "my-awesome-project",
"eslintConfig": {
"extends": "touch4it"
}
}
```

Or to `.eslintrc`:

```json
{
"extends": "touch4it"
"extends": "touch4it"
}
```

[`touch4it/node`](node.js) for [Node.js](https://nodejs.org/) projects:

```json
{
"extends": "touch4it/node"
}
```

Built for ES6+
[`touch4it/mocha`](mocha.js) for [Mocha](https://mochajs.org/)-tested projects:

```json
{
"extends": [
"touch4it/node",
"touch4it/mocha"
]
}
```

This package also exposes [`touch4it/node`](node.js) for general Node.js projects:
[`touch4it/jsdoc`](jsdoc.js) for [JSDoc](https://www.npmjs.com/package/jsdoc)-documented projects:

```json
{
"extends": "touch4it/node"
"extends": [
"touch4it/node",
"touch4it/jsdoc"
]
}
```

[`touch4it/sails`](sails.js) for [Sails.js](https://sailsjs.com/) projects:

```json
{
"extends": "touch4it/sails"
"extends": "touch4it/sails"
}
```

Default Node configuration is written for ESM, however you can still use [`touch4it/commonjs`](commonjs.js) for CommonJS projects:

```json
{
"extends": [
"touch4it/node",
"touch4it/commonjs"
]
}
```

And [`touch4it/browser`](browser.js) for browser:

```json
{
"extends": "touch4it/browser"
"extends": "touch4it/browser"
}
```

Expand Down
6 changes: 3 additions & 3 deletions browser.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module.exports = {
extends: [
'touch4it/es6'
'touch4it',
],
env: {
node: false,
browser: true
browser: true,
},
rules: {
'unicorn/prefer-module': 'off',
}
},
};
11 changes: 11 additions & 0 deletions commonjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: [
'touch4it',
],
env: {
commonjs: true,
},
rules: {
'unicorn/prefer-module': 'off',
},
};
Loading

0 comments on commit a0bf51e

Please sign in to comment.