@haraka/eslint-config 1.1.1 → 1.1.2

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/CHANGELOG.md CHANGED
@@ -4,12 +4,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
4
4
 
5
5
  ### Unreleased
6
6
 
7
- #### [1.1.1] - 2024-04-06
7
+ #### [1.1.2] - 2024-04-06
8
8
 
9
+ - remove rule no-newline-no-curly-if
9
10
  - remove haraka:recommended
10
11
  - remove rules included in eslint:recommended
11
12
 
12
- #### [1.1.0] - 2024-04-06
13
+ #### 1.1.0 - 2024-04-06
13
14
 
14
15
  - chore: update to eslint 8 standards
15
16
  - publish as @haraka/eslint-config
@@ -91,3 +92,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
91
92
  [1.0.11]: https://github.com/haraka/haraka-eslint/releases/tag/1.0.11
92
93
  [1.0.15]: https://github.com/haraka/haraka-eslint/releases/tag/1.0.15
93
94
  [1.0.16]: https://github.com/haraka/haraka-eslint/releases/tag/v1.0.16
95
+ [1.1.2]: https://github.com/haraka/haraka-eslint/releases/tag/v1.1.2
package/README.md CHANGED
@@ -7,24 +7,26 @@
7
7
 
8
8
  ## Install
9
9
 
10
- In your Haraka plugin:
10
+ In your Haraka module:
11
11
 
12
- 1. Install an eslint config file:
12
+ 1. Add to NPM dependencies:
13
+
14
+ `npm install --save-dev @haraka/eslint-config`
15
+
16
+ 2. Configure eslint:
13
17
 
14
18
  ```sh
15
- tee .eslintrc.yaml <<EOLINT
16
- extends: [ @haraka ]
17
- EOLINT
19
+ echo 'extends: "@haraka"' > .eslintrc.yaml
18
20
  ```
19
21
 
20
- 2. Add to the "scripts" section of `package.json`:
22
+ 3. Add to the "scripts" section of `package.json`:
21
23
 
22
24
  ```json
23
25
  "lint": "npx eslint@8 *.js test"
24
26
  "lint:fix": "npx eslint@8 --fix *.js test"
25
27
  ```
26
28
 
27
- 3. Within your CI workflow:
29
+ 4. Within your CI workflow:
28
30
 
29
31
  `npm run lint`
30
32
 
@@ -34,11 +36,11 @@ To check your project against lint rules:
34
36
 
35
37
  `npm run lint`
36
38
 
37
- Step #3 above does this automatically when CI tests are set up.
39
+ Step #4 above does this automatically when CI tests are set up.
38
40
 
39
41
  If you agree with the lint suggestions, you can run `npm run lint:fix` and the changes will be made to your files automatically.
40
42
 
41
- You can add custom rules to your .eslintrc file.
43
+ Custom rules can be added to the .eslintrc file.
42
44
 
43
45
  <!-- leave these buried at the bottom of the document -->
44
46
 
package/index.js CHANGED
@@ -18,7 +18,6 @@ module.exports = {
18
18
  },
19
19
  rules: {
20
20
  // 0 = off // 1 = warn // 2 = error
21
- "no-newline-no-curly-if": require("./rules/no-newline-no-curly-if"),
22
21
  "no-empty": ["error", { allowEmptyCatch: true }],
23
22
  "no-undef": "warn",
24
23
  "no-console": "off",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haraka/eslint-config",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "eslint config for Haraka projects",
5
5
  "keywords": [
6
6
  "eslint",
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- exports.meta = {
4
- docs: {
5
- description: "disallow if() with a single following line and no curlies",
6
- category: "Possible Errors",
7
- recommended: true,
8
- },
9
- fixable: "code",
10
- schema: [], // no options
11
- };
12
-
13
- exports.create = function (context) {
14
- const sourceCode = context.getSourceCode();
15
- const sourceText = sourceCode.getText();
16
-
17
- return {
18
- IfStatement(node) {
19
- if (node.parent.type !== "IfStatement") {
20
- if (node.consequent.type != "BlockStatement") {
21
- // console.log(node);
22
- if (
23
- sourceText.charCodeAt(
24
- sourceCode.getTokenBefore(node.consequent).end,
25
- ) == 10
26
- ) {
27
- context.report({
28
- node: node,
29
- message: "Newline after if with no curly",
30
- });
31
- }
32
- }
33
- }
34
- },
35
- };
36
- };