@ivuorinen/eslint-config 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Ismo Vuorinen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # @ivuorinen/eslint-config <!-- omit in toc -->
2
+
3
+ [![npm package][npm-badge]][npm-link]
4
+ [![license MIT][license-badge]][license-link]
5
+ [![ivuorinen's Code Style][style-badge]][style-link]
6
+
7
+ > ivuorinen's shareable configuration for [`ESLint`][eslint-link].
8
+
9
+ ## Table of Contents <!-- omit in toc -->
10
+
11
+ - [Installation](#installation)
12
+ - [Available Configurations](#available-configurations)
13
+ - [Jest](#jest)
14
+ - [Documentations](#documentations)
15
+ - [Contributing](#contributing)
16
+ - [Changelog](#changelog)
17
+ - [License](#license)
18
+
19
+ ## Installation
20
+
21
+ Install `this config` as a _`devDependencies`_:
22
+
23
+ ```sh
24
+ # npm
25
+ npm install @ivuorinen/eslint-config --save-dev
26
+
27
+ # Yarn
28
+ yarn add @ivuorinen/eslint-config --dev
29
+ ```
30
+
31
+ After installing it, a _`.eslintrc.json`_ file will be created automatically in the project's root folder with the following configuration:
32
+
33
+ ```json
34
+ {
35
+ "extends": ["@ivuorinen"]
36
+ }
37
+ ```
38
+
39
+ ## Available Configurations
40
+
41
+ ### Jest
42
+
43
+ Adds specific rules for the [`Jest`][jest-link] testing framework.
44
+
45
+ ```json
46
+ {
47
+ "extends": ["@ivuorinen/eslint-config/jest"]
48
+ }
49
+ ```
50
+
51
+ ## Documentations
52
+
53
+ Read the [ESLint docs][eslint-docs-link] for more information.
54
+
55
+ ## Contributing
56
+
57
+ If you are interested in helping contribute, please take a look at our [contribution guidelines][contributing-link] and open an [issue][issue-link] or [pull request][pull-request-link].
58
+
59
+ ## Changelog
60
+
61
+ See [CHANGELOG][changelog-link] for a human-readable history of changes.
62
+
63
+ ## License
64
+
65
+ Distributed under the MIT License. See [LICENSE][license-link] for more information.
66
+
67
+ [changelog-link]: ./CHANGELOG.md
68
+ [eslint-docs-link]: https://eslint.org
69
+ [eslint-link]: https://github.com/eslint/eslint
70
+ [contributing-link]: https://github.com/ivuorinen/.github/blob/main/CONTRIBUTING.md
71
+ [issue-link]: https://github.com/ivuorinen/base-configs/issues
72
+ [license-badge]: https://img.shields.io/github/license/ivuorinen/base-configs?style=flat-square&labelColor=292a44&color=663399
73
+ [license-link]: ./LICENSE
74
+ [npm-badge]: https://img.shields.io/npm/v/@ivuorinen/eslint-config?style=flat-square&labelColor=292a44&color=663399
75
+ [npm-link]: https://www.npmjs.com/package/@ivuorinen/eslint-config
76
+ [pull-request-link]: https://github.com/ivuorinen/base-configs/pulls
77
+ [style-badge]: https://img.shields.io/badge/code_style-ivuorinen%E2%80%99s-663399.svg?labelColor=292a44&style=flat-square
78
+ [style-link]: https://github.com/ivuorinen/base-configs
79
+
80
+ [jest-link]: https://jestjs.io
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ 'use strict'
2
+
3
+ module.exports = {
4
+ env: {
5
+ browser: true,
6
+ commonjs: true,
7
+ es2021: true,
8
+ node: true
9
+ },
10
+ extends: [
11
+ 'plugin:promise/recommended',
12
+ 'plugin:sonarjs/recommended',
13
+ 'standard',
14
+ 'plugin:prettier/recommended'
15
+ ],
16
+ parserOptions: {
17
+ ecmaVersion: 12
18
+ }
19
+ }
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@ivuorinen/eslint-config",
3
+ "version": "0.1.0",
4
+ "description": "ivuorinen's shareable configuration for ESLint.",
5
+ "author": {
6
+ "name": "Ismo Vuorinen",
7
+ "url": "https://github.com/ivuorinen"
8
+ },
9
+ "bugs": {
10
+ "url": "https://github.com/ivuorinen/base-configs/issues"
11
+ },
12
+ "engines": {
13
+ "node": ">= 12",
14
+ "npm": ">= 6",
15
+ "yarn": ">=1.20.0"
16
+ },
17
+ "files": [
18
+ "index.js",
19
+ "scripts/*"
20
+ ],
21
+ "homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/eslint-config#readme",
22
+ "keywords": [
23
+ "eslint-config",
24
+ "eslint",
25
+ "config",
26
+ "ivuorinen"
27
+ ],
28
+ "license": "MIT",
29
+ "main": "index.js",
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/ivuorinen/base-configs.git"
36
+ },
37
+ "scripts": {
38
+ "postinstall": "node scripts/postinstall.js"
39
+ },
40
+ "dependencies": {
41
+ "eslint": "8.29.0",
42
+ "eslint-config-prettier": "8.5.0",
43
+ "eslint-config-standard": "17.0.0",
44
+ "eslint-plugin-import": "2.26.0",
45
+ "eslint-plugin-jest": "27.1.6",
46
+ "eslint-plugin-n": "15.6.0",
47
+ "eslint-plugin-prettier": "4.2.1",
48
+ "eslint-plugin-promise": "6.1.1",
49
+ "eslint-plugin-sonarjs": "0.17.0"
50
+ },
51
+ "gitHead": "0b2b89ca98caac7995c4c2a3662f0d338043938b"
52
+ }
@@ -0,0 +1,14 @@
1
+ 'use strict'
2
+
3
+ const fs = require('fs')
4
+ const path = require('path')
5
+
6
+ const filePath = path.join(process.env.INIT_CWD, '.eslintrc.json')
7
+
8
+ const fileConfigObject = {
9
+ extends: ['@ivuorinen']
10
+ }
11
+
12
+ if (!fs.existsSync(filePath)) {
13
+ fs.writeFileSync(filePath, JSON.stringify(fileConfigObject, undefined, 2))
14
+ }