eslint-config-aether 1.2.2 → 1.4.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.md CHANGED
@@ -1,19 +1,19 @@
1
- Copyright © 2017 Raoul van Rüschen
2
-
3
- This software is provided 'as-is', without any express or implied warranty. In
4
- no event will the authors be held liable for any damages arising from the use of
5
- this software.
6
-
7
- Permission is granted to anyone to use this software for any purpose, including
8
- commercial applications, and to alter it and redistribute it freely, subject to
9
- the following restrictions:
10
-
11
- 1. The origin of this software must not be misrepresented; you must not claim
12
- that you wrote the original software. If you use this software in a product,
13
- an acknowledgment in the product documentation would be appreciated but is
14
- not required.
15
-
16
- 2. Altered source versions must be plainly marked as such, and must not be
17
- misrepresented as being the original software.
18
-
19
- 3. This notice may not be removed or altered from any source distribution.
1
+ Copyright © 2017 Raoul van Rüschen
2
+
3
+ This software is provided 'as-is', without any express or implied warranty. In
4
+ no event will the authors be held liable for any damages arising from the use of
5
+ this software.
6
+
7
+ Permission is granted to anyone to use this software for any purpose, including
8
+ commercial applications, and to alter it and redistribute it freely, subject to
9
+ the following restrictions:
10
+
11
+ 1. The origin of this software must not be misrepresented; you must not claim
12
+ that you wrote the original software. If you use this software in a product,
13
+ an acknowledgment in the product documentation would be appreciated but is
14
+ not required.
15
+
16
+ 2. Altered source versions must be plainly marked as such, and must not be
17
+ misrepresented as being the original software.
18
+
19
+ 3. This notice may not be removed or altered from any source distribution.
package/README.md CHANGED
@@ -1,77 +1,77 @@
1
- # Eslint Config Aether
2
-
3
- [![npm version](https://badgen.net/npm/v/eslint-config-aether?color=green)](https://www.npmjs.com/package/eslint-config-aether)
4
-
5
- A custom code style for [ESLint](https://eslint.org/).
6
-
7
- ## Preview
8
-
9
- ```js
10
- const btn = document.getElementById("btn");
11
- let count = 0;
12
-
13
- function render() {
14
-
15
- btn.innerText = `Count: ${count}`;
16
-
17
- }
18
-
19
- btn.addEventListener("click", () => {
20
-
21
- // Count from 1 to 10.
22
- if(count < 10) {
23
-
24
- count += 1;
25
- render();
26
-
27
- }
28
-
29
- });
30
- ```
31
-
32
-
33
- ## Installation
34
-
35
- ```sh
36
- npm install eslint-config-aether
37
- ```
38
-
39
- This package includes optional configurations for TypeScript which require the TypeScript ESLint [plugin](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin) and [parser](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser):
40
-
41
- ```sh
42
- npm install @typescript-eslint/eslint-plugin
43
- npm install @typescript-eslint/parser
44
- ```
45
-
46
- ## Included Configurations
47
-
48
- The `aether` configuration is intended to be used for JavaScript projects, `aether/typescript-basic` is a compatibility configuration for TypeScript projects and `aether/typescript` adds rules that are based on type information.
49
-
50
- | Config | Parent Configs |
51
- |---------------------------|----------------------------------------------------------------------------------|
52
- | `aether` | `eslint:recommended` |
53
- | `aether/typescript` | `aether`, `plugin:@typescript-eslint/eslint-recommended-requiring-type-checking` |
54
- | `aether/typescript-basic` | `aether`, `plugin:@typescript-eslint/eslint-recommended` |
55
-
56
-
57
- ## Usage
58
-
59
- Note: The config `aether/typescript` sets `parserOptions.project` to `"tsconfig.json"` by default.
60
-
61
- #### package.json
62
-
63
- ```json
64
- {
65
- "eslintConfig": {
66
- "extends": "aether/typescript"
67
- }
68
- }
69
- ```
70
-
71
- #### .eslintrc
72
-
73
- ```json
74
- {
75
- "extends": "aether/typescript"
76
- }
77
- ```
1
+ # Eslint Config Aether
2
+
3
+ [![npm version](https://badgen.net/npm/v/eslint-config-aether?color=green)](https://www.npmjs.com/package/eslint-config-aether)
4
+
5
+ A custom code style for [ESLint](https://eslint.org/).
6
+
7
+ ## Preview
8
+
9
+ ```js
10
+ const btn = document.getElementById("btn");
11
+ let count = 0;
12
+
13
+ function render() {
14
+
15
+ btn.innerText = `Count: ${count}`;
16
+
17
+ }
18
+
19
+ btn.addEventListener("click", () => {
20
+
21
+ // Count from 1 to 10.
22
+ if(count < 10) {
23
+
24
+ count += 1;
25
+ render();
26
+
27
+ }
28
+
29
+ });
30
+ ```
31
+
32
+
33
+ ## Installation
34
+
35
+ ```sh
36
+ npm install eslint-config-aether
37
+ ```
38
+
39
+ This package includes optional configurations for TypeScript which require the TypeScript ESLint [plugin](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin) and [parser](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser):
40
+
41
+ ```sh
42
+ npm install @typescript-eslint/eslint-plugin
43
+ npm install @typescript-eslint/parser
44
+ ```
45
+
46
+ ## Included Configurations
47
+
48
+ The `aether` configuration is intended to be used for JavaScript projects, `aether/typescript-basic` is a compatibility configuration for TypeScript projects and `aether/typescript` adds rules that rely on type checking.
49
+
50
+ | Config | Parent Configs |
51
+ |---------------------------|----------------------------------------------------------------------------------|
52
+ | `aether` | `eslint:recommended` |
53
+ | `aether/typescript` | `aether`, `plugin:@typescript-eslint/eslint-recommended-requiring-type-checking` |
54
+ | `aether/typescript-basic` | `aether`, `plugin:@typescript-eslint/eslint-recommended` |
55
+
56
+
57
+ ## Usage
58
+
59
+ Note: The config `aether/typescript` sets `parserOptions.project` to `"tsconfig.json"` by default.
60
+
61
+ #### package.json
62
+
63
+ ```json
64
+ {
65
+ "eslintConfig": {
66
+ "extends": "aether/typescript"
67
+ }
68
+ }
69
+ ```
70
+
71
+ #### .eslintrc
72
+
73
+ ```json
74
+ {
75
+ "extends": "aether/typescript"
76
+ }
77
+ ```
package/default.js CHANGED
@@ -1,120 +1,101 @@
1
- module.exports = {
2
-
3
- "extends": "eslint:recommended",
4
-
5
- "env": {
6
-
7
- "es2021": true,
8
- "browser": true,
9
- "worker": true,
10
- "jquery": true,
11
- "node": true
12
-
13
- },
14
-
15
- "parserOptions": {
16
-
17
- "sourceType": "module",
18
- "impliedStrict": true
19
-
20
- },
21
-
22
- "rules": {
23
-
24
- "array-bracket-spacing": ["error", "never"],
25
- "block-spacing": ["error", "always"],
26
-
27
- "brace-style": ["error", "1tbs", {
28
- "allowSingleLine": true
29
- }],
30
-
31
- "camelcase": "warn",
32
- "comma-dangle": ["error", "never"],
33
- "comma-spacing": "error",
34
- "comma-style": ["error", "last"],
35
- "consistent-return": "error",
36
- "computed-property-spacing": ["error", "never"],
37
- "curly": "error",
38
- "dot-notation": "error",
39
- "eol-last": ["error", "always"],
40
- "eqeqeq": "error",
41
- "func-call-spacing": ["error", "never"],
42
-
43
- "indent": ["error", "tab", {
44
- "SwitchCase": 1
45
- }],
46
-
47
- "key-spacing": "error",
48
-
49
- "keyword-spacing": ["error", {
50
- "overrides": {
51
- "catch": { "after": false },
52
- "if": { "after": false },
53
- "for": { "after": false },
54
- "switch": { "after": false },
55
- "while": { "after": false },
56
- }
57
- }],
58
-
59
- "lines-between-class-members": ["warn", "always", {
60
- "exceptAfterSingleLine": true
61
- }],
62
-
63
- "new-cap": "error",
64
- "new-parens": "error",
65
-
66
- "no-array-constructor": "error",
67
- "no-alert": "warn",
68
- "no-caller": "error",
69
- "no-console": "off",
70
- "no-debugger": "warn",
71
- "no-else-return": "error",
72
- "no-extend-native": "error",
73
- "no-extra-bind": "error",
74
- "no-extra-semi": "error",
75
- "no-iterator": "error",
76
- "no-labels": "error",
77
- "no-lone-blocks": "error",
78
- "no-loop-func": "error",
79
- "no-mixed-spaces-and-tabs": "error",
80
- "no-multiple-empty-lines": "warn",
81
- "no-multi-spaces": "warn",
82
- "no-new": "error",
83
- "no-new-func": "error",
84
- "no-new-object": "error",
85
- "no-new-wrappers": "error",
86
- "no-trailing-spaces": "warn",
87
- "no-undef-init": "error",
88
- "no-underscore-dangle": "error",
89
-
90
- "no-unused-vars": ["warn", {
91
- "vars": "all",
92
- "args": "none"
93
- }],
94
-
95
- "no-var": "error",
96
- "no-whitespace-before-property": "error",
97
-
98
- "object-curly-spacing": ["error", "always"],
99
-
100
- "padded-blocks": ["error", "always", {
101
- "allowSingleLineBlocks": true
102
- }],
103
-
104
- "quotes": ["error", "double"],
105
-
106
- "semi": ["error", "always"],
107
- "semi-spacing": "error",
108
- "space-before-blocks": ["error", "always"],
109
- "space-before-function-paren": ["error", "never"],
110
- "space-in-parens": ["error", "never"],
111
- "space-infix-ops": "error",
112
- "space-unary-ops": "error",
113
- "spaced-comment": ["warn", "always"],
114
-
115
- "wrap-iife": "warn",
116
- "yoda": ["error", "never"]
117
-
118
- }
119
-
120
- };
1
+ module.exports = {
2
+ "extends": "eslint:recommended",
3
+ "env": {
4
+ "es2022": true,
5
+ "browser": true,
6
+ "worker": true,
7
+ "jquery": true,
8
+ "node": true
9
+ },
10
+ "parserOptions": {
11
+ "sourceType": "module",
12
+ "impliedStrict": true
13
+ },
14
+ "rules": {
15
+ "array-bracket-spacing": ["error", "never"],
16
+ "block-spacing": ["error", "always"],
17
+ "brace-style": ["error", "1tbs", {
18
+ "allowSingleLine": true
19
+ }],
20
+ "camelcase": "warn",
21
+ "comma-dangle": ["error", "never"],
22
+ "comma-spacing": "error",
23
+ "comma-style": ["error", "last"],
24
+ "consistent-return": "error",
25
+ "computed-property-spacing": ["error", "never"],
26
+ "curly": "error",
27
+ "dot-notation": "error",
28
+ "eol-last": ["error", "always"],
29
+ "eqeqeq": "error",
30
+ "func-call-spacing": ["error", "never"],
31
+ "indent": ["error", "tab", {
32
+ "SwitchCase": 1
33
+ }],
34
+ "key-spacing": "error",
35
+ "keyword-spacing": ["error", {
36
+ "overrides": {
37
+ "catch": { "after": false },
38
+ "if": { "after": false },
39
+ "for": { "after": false },
40
+ "switch": { "after": false },
41
+ "while": { "after": false },
42
+ }
43
+ }],
44
+ "lines-between-class-members": ["warn", "always", {
45
+ "exceptAfterSingleLine": true
46
+ }],
47
+ "max-len": ["warn", {
48
+ "code": 120,
49
+ "tabWidth": 2,
50
+ "ignoreComments": true
51
+ }],
52
+ "new-cap": "error",
53
+ "new-parens": "error",
54
+ "no-array-constructor": "error",
55
+ "no-alert": "warn",
56
+ "no-caller": "error",
57
+ "no-console": "off",
58
+ "no-debugger": "warn",
59
+ "no-else-return": "error",
60
+ "no-extend-native": "error",
61
+ "no-extra-bind": "error",
62
+ "no-extra-semi": "error",
63
+ "no-iterator": "error",
64
+ "no-labels": "error",
65
+ "no-lone-blocks": "error",
66
+ "no-loop-func": "error",
67
+ "no-mixed-spaces-and-tabs": "error",
68
+ "no-multiple-empty-lines": "warn",
69
+ "no-multi-spaces": "warn",
70
+ "no-new": "error",
71
+ "no-new-func": "error",
72
+ "no-new-object": "error",
73
+ "no-new-wrappers": "error",
74
+ "no-trailing-spaces": "warn",
75
+ "no-undef-init": "error",
76
+ "no-underscore-dangle": ["error", {
77
+ "allowAfterThis": true
78
+ }],
79
+ "no-unused-vars": ["warn", {
80
+ "vars": "all",
81
+ "args": "none"
82
+ }],
83
+ "no-var": "error",
84
+ "no-whitespace-before-property": "error",
85
+ "object-curly-spacing": ["error", "always"],
86
+ "padded-blocks": ["error", "always", {
87
+ "allowSingleLineBlocks": true
88
+ }],
89
+ "quotes": ["error", "double"],
90
+ "semi": ["error", "always"],
91
+ "semi-spacing": "error",
92
+ "space-before-blocks": ["error", "always"],
93
+ "space-before-function-paren": ["error", "never"],
94
+ "space-in-parens": ["error", "never"],
95
+ "space-infix-ops": "error",
96
+ "space-unary-ops": "error",
97
+ "spaced-comment": ["warn", "always"],
98
+ "wrap-iife": "warn",
99
+ "yoda": ["error", "never"]
100
+ }
101
+ };
package/index.js CHANGED
@@ -1 +1 @@
1
- module.exports = require("./default.js");
1
+ module.exports = require("./default.js");
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
- {
2
- "name": "eslint-config-aether",
3
- "version": "1.2.2",
4
- "description": "A custom code style for ESLint.",
5
- "homepage": "https://github.com/vanruesc/eslint-config-aether",
6
- "main": "index.js",
7
- "license": "Zlib",
8
- "keywords": [
9
- "code",
10
- "style",
11
- "syntax",
12
- "checking",
13
- "eslint",
14
- "config",
15
- "lint",
16
- "hint",
17
- "typescript",
18
- "ts"
19
- ],
20
- "author": {
21
- "name": "Raoul van Rüschen",
22
- "email": "vanruesc@outlook.de"
23
- },
24
- "repository": {
25
- "type": "git",
26
- "url": "https://github.com/vanruesc/eslint-config-aether.git"
27
- },
28
- "bugs": {
29
- "url": "https://github.com/vanruesc/eslint-config-aether/issues"
30
- },
31
- "files": [
32
- "default.js",
33
- "index.js",
34
- "typescript.js",
35
- "typescript-basic.js"
36
- ]
37
- }
1
+ {
2
+ "name": "eslint-config-aether",
3
+ "version": "1.4.0",
4
+ "description": "A custom code style for ESLint.",
5
+ "homepage": "https://github.com/vanruesc/eslint-config-aether",
6
+ "main": "index.js",
7
+ "license": "Zlib",
8
+ "keywords": [
9
+ "code",
10
+ "style",
11
+ "syntax",
12
+ "checking",
13
+ "eslint",
14
+ "config",
15
+ "lint",
16
+ "hint",
17
+ "typescript",
18
+ "ts"
19
+ ],
20
+ "author": {
21
+ "name": "Raoul van Rüschen",
22
+ "email": "vanruesc@outlook.de"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/vanruesc/eslint-config-aether.git"
27
+ },
28
+ "bugs": {
29
+ "url": "https://github.com/vanruesc/eslint-config-aether/issues"
30
+ },
31
+ "files": [
32
+ "default.js",
33
+ "index.js",
34
+ "typescript.js",
35
+ "typescript-basic.js"
36
+ ]
37
+ }
@@ -1,35 +1,26 @@
1
- module.exports = {
2
-
3
- "plugins": ["@typescript-eslint"],
4
- "parser": "@typescript-eslint/parser",
5
-
6
- "parserOptions": {
7
- "project": [
8
- "tsconfig.json"
9
- ]
10
- },
11
-
12
- "extends": [
13
- "aether/default",
14
- "plugin:@typescript-eslint/recommended"
15
- ],
16
-
17
- "rules": {
18
-
19
- "indent": "off",
20
- "no-undef": "off",
21
- "no-unused-vars": "off",
22
-
23
- "@typescript-eslint/indent": ["error", "tab", {
24
- "SwitchCase": 1
25
- }],
26
-
27
- "@typescript-eslint/no-empty-function": "off",
28
- "@typescript-eslint/no-unused-vars": ["warn", {
29
- "vars": "all",
30
- "args": "none"
31
- }]
32
-
33
- }
34
-
35
- };
1
+ module.exports = {
2
+ "plugins": ["@typescript-eslint"],
3
+ "parser": "@typescript-eslint/parser",
4
+ "parserOptions": {
5
+ "project": [
6
+ "tsconfig.json"
7
+ ]
8
+ },
9
+ "extends": [
10
+ "aether/default",
11
+ "plugin:@typescript-eslint/recommended"
12
+ ],
13
+ "rules": {
14
+ "indent": "off",
15
+ "no-undef": "off",
16
+ "no-unused-vars": "off",
17
+ "@typescript-eslint/indent": ["error", "tab", {
18
+ "SwitchCase": 1
19
+ }],
20
+ "@typescript-eslint/no-empty-function": "off",
21
+ "@typescript-eslint/no-unused-vars": ["warn", {
22
+ "vars": "all",
23
+ "args": "none"
24
+ }]
25
+ }
26
+ };
package/typescript.js CHANGED
@@ -1,55 +1,51 @@
1
- module.exports = require("./typescript-basic.js");
2
-
3
- module.exports.extends.push(
4
- "plugin:@typescript-eslint/recommended-requiring-type-checking"
5
- );
6
-
7
- Object.assign(module.exports.rules, {
8
-
9
- "camelcase": "off",
10
-
11
- "@typescript-eslint/naming-convention": ["error",
12
- {
13
- "selector": "default",
14
- "format": ["camelCase"]
15
- },
16
- {
17
- "selector": "variable",
18
- "format": ["camelCase", "UPPER_CASE"]
19
- },
20
- {
21
- "selector": "parameter",
22
- "format": ["camelCase"],
23
- "leadingUnderscore": "allow"
24
- },
25
- {
26
- "selector": "accessor",
27
- "modifiers": ["static"],
28
- "format": ["camelCase", "UPPER_CASE"]
29
- },
30
- {
31
- "selector": "classProperty",
32
- "modifiers": ["static", "readonly"],
33
- "format": ["camelCase", "UPPER_CASE"]
34
- },
35
- {
36
- "selector": "memberLike",
37
- "modifiers": ["private"],
38
- "format": ["camelCase"],
39
- "leadingUnderscore": "forbid"
40
- },
41
- {
42
- "selector": ["objectLiteralProperty", "objectLiteralMethod"],
43
- "format": null
44
- },
45
- {
46
- "selector": "enumMember",
47
- "format": ["UPPER_CASE"]
48
- },
49
- {
50
- "selector": "typeLike",
51
- "format": ["PascalCase"]
52
- }
53
- ]
54
-
55
- });
1
+ module.exports = require("./typescript-basic.js");
2
+
3
+ module.exports.extends.push(
4
+ "plugin:@typescript-eslint/recommended-requiring-type-checking"
5
+ );
6
+
7
+ Object.assign(module.exports.rules, {
8
+ "camelcase": "off",
9
+ "no-underscore-dangle": "off",
10
+ "@typescript-eslint/naming-convention": ["error",
11
+ {
12
+ "selector": "default",
13
+ "format": ["camelCase"]
14
+ },
15
+ {
16
+ "selector": ["variable", "accessor"],
17
+ "format": ["camelCase", "UPPER_CASE"]
18
+ },
19
+ {
20
+ "selector": ["parameter", "property"],
21
+ "format": ["camelCase"],
22
+ "leadingUnderscore": "allow"
23
+ },
24
+ {
25
+ "selector": "classProperty",
26
+ "modifiers": ["static", "readonly"],
27
+ "format": ["PascalCase", "UPPER_CASE"],
28
+ "leadingUnderscore": "forbid"
29
+ },
30
+ {
31
+ selector: "typeLike",
32
+ format: ["PascalCase"]
33
+ },
34
+ {
35
+ "selector": "enumMember",
36
+ "format": ["UPPER_CASE"]
37
+ },
38
+ {
39
+ "selector": ["objectLiteralProperty", "objectLiteralMethod"],
40
+ "format": null
41
+ },
42
+ {
43
+ selector: "interface",
44
+ format: ["PascalCase"],
45
+ custom: {
46
+ regex: "^I[A-Z]",
47
+ match: false
48
+ }
49
+ }
50
+ ]
51
+ });