@kembec/eslint-config 1.0.1 → 1.0.3

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.
@@ -4,20 +4,19 @@ on:
4
4
  push:
5
5
  branches:
6
6
  - main
7
- pull_request:
8
- branches:
9
- - main
10
7
 
11
8
  jobs:
12
9
  npm-publish:
13
10
  runs-on: ubuntu-latest
11
+ environment: NPM
14
12
  steps:
15
13
  - uses: actions/checkout@v3
16
14
  - uses: actions/setup-node@v3
17
15
  with:
18
- node-version: '12'
16
+ node-version: '16'
17
+ registry-url: 'https://registry.npmjs.org/'
19
18
  - run: npm install
20
- - run: npm test
19
+ - run: npm run build --if-present
21
20
  - uses: JS-DevTools/npm-publish@v1
22
21
  with:
23
22
  token: ${{ secrets.TOKEN_NPM }}
package/Readme.md CHANGED
@@ -1,40 +1,72 @@
1
- # My personal JavaScript/TypeScript linter configuration
1
+ # Streamlined ESLint Configuration for JS/TS Projects
2
2
 
3
+ This document outlines the steps to integrate my ESLint setup into your JavaScript or TypeScript projects. It's a personal collection of configurations and plugins aimed at fostering a consistent coding style and catching common errors.
3
4
 
4
- ## Getting Start
5
+ ## Quick Start Guide
5
6
 
6
- - Install
7
- ```
8
- npm install -D @kembec/eslint-config
9
- ```
7
+ ### Step 1: Installation
10
8
 
11
- - Add in the .eslintrc{,.js,.ts} file
12
- ```
13
- extends: [ "@kembec/eslint-config" ]
14
- ```
15
-
16
- - If you use TypeScript
17
- ```
9
+ Add the configuration package to your development dependencies:
10
+
11
+ ```bash
12
+ npm install -D @kembec/eslint-config
13
+ ```
14
+
15
+ ### Step 2: Configure ESLint
16
+
17
+ Modify your ESLint configuration file to use this package. The setup varies slightly depending on whether you're working with plain JavaScript or TypeScript.
18
+
19
+ - **For JavaScript Projects**: In your `.eslintrc` (which could be a `.json`, `.js`, or `.ts` file), include the following:
20
+
21
+ ```json
22
+ {
23
+ "extends": ["@kembec/eslint-config"]
24
+ }
25
+ ```
26
+
27
+ - **For TypeScript Projects**: To incorporate TypeScript-specific rules and configure the parser options, use this setup:
28
+
29
+ ```json
30
+ {
31
+ "extends": ["@kembec/eslint-config/typescript"],
32
+ "overrides": [
18
33
  {
19
- extends: ["@kembec/eslint-config/typescript"],
20
- overrides: [
21
- {
22
- files: ["*.ts", "*.tsx"],
23
- parserOptions: {
24
- project: ["./tsconfig.json"],
25
- },
26
- },
27
- ]
34
+ "files": ["*.ts", "*.tsx"],
35
+ "parserOptions": {
36
+ "project": ["./tsconfig.json"]
37
+ }
28
38
  }
29
- ```
39
+ ]
40
+ }
41
+ ```
42
+
43
+ ## Included Plugins
44
+
45
+ The configuration incorporates a carefully selected set of ESLint plugins to assist with various code quality and style concerns:
46
+
47
+ - `eslint-plugin-import`: Manages and validates import statements.
48
+ - `eslint-plugin-jest`: Provides linting rules for Jest tests.
49
+ - `eslint-plugin-prettier`: Integrates Prettier formatting into ESLint.
50
+ - `eslint-plugin-simple-import-sort`: Automatically sorts import statements.
51
+ - `eslint-plugin-unused-imports`: Helps in removing unused imports.
52
+ - `@typescript-eslint/eslint-plugin`: Adds TypeScript-specific linting rules.
53
+ - `@typescript-eslint/parser`: Allows ESLint to parse TypeScript code.
54
+
55
+ These plugins are intended to help maintain a clean codebase and promote coding best practices.
56
+
57
+ ## Usage
58
+
59
+ Integrate linting into your workflow with these npm scripts:
60
+
61
+ ```json
62
+ "scripts": {
63
+ "lint": "eslint .",
64
+ "lint:fix": "eslint --fix ."
65
+ }
66
+ ```
30
67
 
68
+ Use `npm run lint` to identify issues or `npm run lint:fix` to fix many issues automatically.
31
69
 
32
- ## Plugins Included
70
+ ## License
33
71
 
34
- - eslint-plugin-import
35
- - eslint-plugin-jest
36
- - eslint-plugin-prettier
37
- - eslint-plugin-simple-import-sort
38
- - eslint-plugin-unused-import
39
- - @typescript-eslint/eslint-plugin
40
- - @typescript-eslint/parser
72
+ `Sunat Utils` is licensed under the [AGPL-3.0](https://opensource.org/licenses/AGPL-3.0). Its use, modification, and distribution are allowed under the terms of this license.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kembec/eslint-config",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "My personal linter configuration for JavaScript/TypeScript",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -53,6 +53,7 @@ module.exports = {
53
53
  "@typescript-eslint/prefer-nullish-coalescing": ["error"],
54
54
  "@typescript-eslint/prefer-readonly": ["error"],
55
55
  "@typescript-eslint/promise-function-async": ["error", { checkArrowFunctions: false }],
56
+ "@typescript-eslint/require-await": ["warn"],
56
57
  "@typescript-eslint/switch-exhaustiveness-check": ["error"],
57
58
  "@typescript-eslint/explicit-member-accessibility": [
58
59
  "error",
@@ -7,7 +7,7 @@ module.exports = {
7
7
  ecmaVersion: 12,
8
8
  sourceType: "module",
9
9
  },
10
- extends: ["./index.js"],
10
+ extends: ["../index.js"],
11
11
  overrides: [
12
12
  {
13
13
  files: ["*.ts", "*.tsx"],
@@ -15,7 +15,7 @@ module.exports = {
15
15
  "plugin:@typescript-eslint/recommended",
16
16
  "plugin:@typescript-eslint/recommended-requiring-type-checking",
17
17
  "plugin:import/typescript",
18
- ...["./rules/typescript"].map(require.resolve),
18
+ ...["../rules/typescript"].map(require.resolve),
19
19
  ],
20
20
  },
21
21
  {