@luxass/eslint-config 1.0.7 → 2.0.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/README.md CHANGED
@@ -1,3 +1,16 @@
1
- # eslint-config
1
+ # @luxass/eslint-config
2
2
 
3
- My shareable ESLint config
3
+ ## Installation
4
+
5
+ ```bash
6
+ pnpm add -D eslint @luxass/eslint-config
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ `.eslintrc`
12
+ ```json
13
+ {
14
+ "extends": "@luxass"
15
+ }
16
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
- "version": "1.0.7",
4
- "description": "Luxass' ESLint config",
3
+ "version": "2.0.0",
4
+ "description": "luxass' ESLint config",
5
5
  "author": {
6
6
  "name": "Lucas Norgaard",
7
7
  "email": "lucasnrgaard@gmail.com",
@@ -23,34 +23,32 @@
23
23
  "src"
24
24
  ],
25
25
  "peerDependencies": {
26
- "eslint": "^8.20.0"
26
+ "eslint": "^8.29.0",
27
+ "typescript": "^4.9.4"
27
28
  },
28
29
  "dependencies": {
29
- "@typescript-eslint/eslint-plugin": "^5.30.6",
30
- "@typescript-eslint/parser": "^5.30.6",
30
+ "@typescript-eslint/eslint-plugin": "^5.46.0",
31
+ "@typescript-eslint/parser": "^5.46.0",
31
32
  "eslint-config-standard": "^17.0.0",
32
33
  "eslint-plugin-eslint-comments": "^3.2.0",
33
34
  "eslint-plugin-import": "^2.26.0",
34
- "eslint-plugin-jsonc": "^2.3.1",
35
+ "eslint-plugin-jsonc": "^2.5.0",
35
36
  "eslint-plugin-markdown": "^3.0.0",
36
- "eslint-plugin-n": "^15.2.4",
37
- "eslint-plugin-promise": "^6.0.0",
38
- "eslint-plugin-react": "^7.30.1",
39
- "eslint-plugin-unicorn": "^43.0.1",
40
- "eslint-plugin-yml": "^1.0.0",
37
+ "eslint-plugin-n": "^15.6.0",
38
+ "eslint-plugin-promise": "^6.1.1",
39
+ "eslint-plugin-react": "^7.31.11",
40
+ "eslint-plugin-unicorn": "^45.0.1",
41
+ "eslint-plugin-yml": "^1.3.0",
41
42
  "jsonc-eslint-parser": "^2.1.0"
42
43
  },
43
44
  "devDependencies": {
44
- "@luxass/prettier-config": "^1.0.4",
45
- "bumpp": "^7.2.0",
46
- "eslint": "^8.20.0",
47
- "prettier": "^2.7.1",
48
- "typescript": "^4.7.4"
45
+ "bumpp": "^8.2.1",
46
+ "eslint": "^8.29.0",
47
+ "typescript": "^4.9.4"
49
48
  },
50
49
  "scripts": {
51
50
  "bump": "bumpp package.json --commit --push --tag",
52
51
  "release": "pnpm -r publish --access public",
53
- "format": "prettier --write --cache .",
54
52
  "lint": "eslint --cache src/**/*.js"
55
53
  }
56
54
  }
package/src/javascript.js CHANGED
@@ -1,126 +1,126 @@
1
1
  module.exports = {
2
2
  rules: {
3
- 'import/order': 'error',
4
- 'import/first': 'error',
5
- 'import/no-mutable-exports': 'error',
6
- 'import/no-unresolved': 'off',
7
- 'import/no-absolute-path': 'off',
8
- semi: ['warn', 'always'],
9
- quotes: ['error', 'double'],
10
- 'quote-props': ['warn', 'as-needed'],
11
- 'no-unused-vars': 'warn',
12
- 'no-param-reassign': 'off',
13
- 'array-bracket-spacing': ['error', 'never'],
14
- 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
15
- 'block-spacing': ['error', 'always'],
16
- camelcase: 'off',
17
- 'comma-spacing': ['error', { before: false, after: true }],
18
- 'comma-style': ['error', 'last'],
19
- 'comma-dangle': ['error', 'only-multiline'],
20
- 'no-constant-condition': 'warn',
21
- 'no-debugger': 'error',
22
- 'no-console': ['warn', { allow: ['warn', 'error'] }],
23
- 'no-cond-assign': ['error', 'always'],
24
- 'func-call-spacing': ['off', 'never'],
25
- 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
26
- indent: ['error', 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }],
27
- 'no-restricted-syntax': ['error', 'DebuggerStatement', 'LabeledStatement', 'WithStatement'],
28
- 'object-curly-spacing': ['error', 'always'],
29
- 'no-return-await': 'off',
30
- 'space-before-function-paren': [
31
- 'error',
3
+ "import/order": "error",
4
+ "import/first": "error",
5
+ "import/no-mutable-exports": "error",
6
+ "import/no-unresolved": "off",
7
+ "import/no-absolute-path": "off",
8
+ semi: ["warn", "always"],
9
+ quotes: ["error", "double"],
10
+ "quote-props": ["warn", "as-needed"],
11
+ "no-unused-vars": "warn",
12
+ "no-param-reassign": "off",
13
+ "array-bracket-spacing": ["error", "never"],
14
+ "brace-style": ["error", "1tbs", { allowSingleLine: true }],
15
+ "block-spacing": ["error", "always"],
16
+ camelcase: "off",
17
+ "comma-spacing": ["error", { before: false, after: true }],
18
+ "comma-style": ["error", "last"],
19
+ "comma-dangle": ["error", "only-multiline"],
20
+ "no-constant-condition": "warn",
21
+ "no-debugger": "error",
22
+ "no-console": ["warn", { allow: ["warn", "error"] }],
23
+ "no-cond-assign": ["error", "always"],
24
+ "func-call-spacing": ["off", "never"],
25
+ "key-spacing": ["error", { beforeColon: false, afterColon: true }],
26
+ indent: ["error", 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }],
27
+ "no-restricted-syntax": ["error", "DebuggerStatement", "LabeledStatement", "WithStatement"],
28
+ "object-curly-spacing": ["error", "always"],
29
+ "no-return-await": "off",
30
+ "space-before-function-paren": [
31
+ "error",
32
32
  {
33
- anonymous: 'always',
34
- named: 'never',
35
- asyncArrow: 'always'
33
+ anonymous: "always",
34
+ named: "never",
35
+ asyncArrow: "always"
36
36
  }
37
37
  ],
38
38
  // "no-multiple-empty-lines": ["warn", { max: 1, maxBOF: 0, maxEOF: 0 }],
39
- 'no-multiple-empty-lines': 'off',
40
- 'no-var': 'error',
41
- 'prefer-const': [
42
- 'error',
39
+ "no-multiple-empty-lines": "off",
40
+ "no-var": "error",
41
+ "prefer-const": [
42
+ "error",
43
43
  {
44
- destructuring: 'any',
44
+ destructuring: "any",
45
45
  ignoreReadBeforeAssign: true
46
46
  }
47
47
  ],
48
- 'prefer-arrow-callback': [
49
- 'error',
48
+ "prefer-arrow-callback": [
49
+ "error",
50
50
  {
51
51
  allowNamedFunctions: false,
52
52
  allowUnboundThis: true
53
53
  }
54
54
  ],
55
- 'object-shorthand': [
56
- 'error',
57
- 'always',
55
+ "object-shorthand": [
56
+ "error",
57
+ "always",
58
58
  {
59
59
  ignoreConstructors: false,
60
60
  avoidQuotes: true
61
61
  }
62
62
  ],
63
- 'prefer-exponentiation-operator': 'error',
64
- 'prefer-rest-params': 'error',
65
- 'prefer-spread': 'error',
66
- 'prefer-template': 'error',
67
- 'template-curly-spacing': 'error',
68
- 'generator-star-spacing': 'off',
69
- 'spaced-comment': [
70
- 'error',
71
- 'always',
63
+ "prefer-exponentiation-operator": "error",
64
+ "prefer-rest-params": "error",
65
+ "prefer-spread": "error",
66
+ "prefer-template": "error",
67
+ "template-curly-spacing": "error",
68
+ "generator-star-spacing": "off",
69
+ "spaced-comment": [
70
+ "error",
71
+ "always",
72
72
  {
73
73
  line: {
74
- markers: ['/'],
75
- exceptions: ['/', '#']
74
+ markers: ["/"],
75
+ exceptions: ["/", "#"]
76
76
  },
77
77
  block: {
78
- markers: ['!'],
79
- exceptions: ['*'],
78
+ markers: ["!"],
79
+ exceptions: ["*"],
80
80
  balanced: true
81
81
  }
82
82
  }
83
83
  ],
84
- 'array-callback-return': 'error',
85
- 'block-scoped-var': 'error',
86
- 'consistent-return': 'off',
87
- complexity: ['off', 11],
88
- eqeqeq: ['error', 'smart'],
89
- 'no-alert': 'warn',
90
- 'no-case-declarations': 'error',
91
- 'no-multi-spaces': 'error',
92
- 'no-multi-str': 'error',
93
- 'no-with': 'error',
94
- 'no-void': 'error',
95
- 'no-useless-escape': 'off',
96
- 'vars-on-top': 'error',
97
- 'require-await': 'off',
98
- 'no-return-assign': 'off',
99
- 'operator-linebreak': ['error', 'before'],
100
- 'unicorn/error-message': 'error',
101
- 'unicorn/escape-case': 'error',
102
- 'unicorn/no-instanceof-array': 'error',
103
- 'unicorn/no-new-buffer': 'error',
104
- 'unicorn/no-unsafe-regex': 'off',
105
- 'unicorn/number-literal-case': 'error',
106
- 'unicorn/prefer-includes': 'error',
107
- 'unicorn/prefer-starts-ends-with': 'error',
108
- 'unicorn/prefer-text-content': 'error',
109
- 'unicorn/prefer-type-error': 'error',
110
- 'unicorn/throw-new-error': 'error',
111
- 'no-use-before-define': ['error', { functions: false, classes: false, variables: true }],
112
- 'eslint-comments/disable-enable-pair': 'off',
113
- 'import/no-named-as-default-member': 'off',
114
- 'import/no-named-as-default': 'off',
115
- 'import/namespace': 'off',
116
- 'n/no-callback-literal': 'off',
117
- 'sort-imports': [
118
- 'error',
84
+ "array-callback-return": "error",
85
+ "block-scoped-var": "error",
86
+ "consistent-return": "off",
87
+ complexity: ["off", 11],
88
+ eqeqeq: ["error", "smart"],
89
+ "no-alert": "warn",
90
+ "no-case-declarations": "error",
91
+ "no-multi-spaces": "error",
92
+ "no-multi-str": "error",
93
+ "no-with": "error",
94
+ "no-void": "error",
95
+ "no-useless-escape": "off",
96
+ "vars-on-top": "error",
97
+ "require-await": "off",
98
+ "no-return-assign": "off",
99
+ "operator-linebreak": ["error", "before"],
100
+ "unicorn/error-message": "error",
101
+ "unicorn/escape-case": "error",
102
+ "unicorn/no-instanceof-array": "error",
103
+ "unicorn/no-new-buffer": "error",
104
+ "unicorn/no-unsafe-regex": "off",
105
+ "unicorn/number-literal-case": "error",
106
+ "unicorn/prefer-includes": "error",
107
+ "unicorn/prefer-starts-ends-with": "error",
108
+ "unicorn/prefer-text-content": "error",
109
+ "unicorn/prefer-type-error": "error",
110
+ "unicorn/throw-new-error": "error",
111
+ "no-use-before-define": ["error", { functions: false, classes: false, variables: true }],
112
+ "eslint-comments/disable-enable-pair": "off",
113
+ "import/no-named-as-default-member": "off",
114
+ "import/no-named-as-default": "off",
115
+ "import/namespace": "off",
116
+ "n/no-callback-literal": "off",
117
+ "sort-imports": [
118
+ "error",
119
119
  {
120
120
  ignoreCase: false,
121
121
  ignoreDeclarationSort: true,
122
122
  ignoreMemberSort: false,
123
- memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
123
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
124
124
  allowSeparatedGroups: false
125
125
  }
126
126
  ]
package/src/typescript.js CHANGED
@@ -1,32 +1,27 @@
1
1
  module.exports = {
2
2
  extends: [
3
- 'plugin:import/typescript',
4
- 'plugin:@typescript-eslint/recommended',
5
- 'plugin:react/recommended'
3
+ "plugin:import/typescript",
4
+ "plugin:@typescript-eslint/recommended",
5
+ "plugin:react/recommended"
6
6
  ],
7
7
  settings: {
8
- 'import/resolver': {
9
- node: { extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', '.d.ts'] }
8
+ "import/resolver": {
9
+ node: { extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".d.ts"] }
10
10
  },
11
11
  react: {
12
- version: '17.0'
12
+ version: "17.0"
13
13
  }
14
14
  },
15
15
  rules: {
16
- 'import/named': 'off',
17
- '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
18
- '@typescript-eslint/member-delimiter-style': 'warn',
19
- '@typescript-eslint/type-annotation-spacing': ['error', {}],
20
- '@typescript-eslint/consistent-type-imports': [
21
- 'warn',
22
- { prefer: 'no-type-imports', disallowTypeAnnotations: false }
23
- ],
24
- '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
25
- '@typescript-eslint/prefer-ts-expect-error': 'error',
26
- 'no-useless-constructor': 'off',
27
- indent: 'off',
28
- '@typescript-eslint/indent': [
29
- 'error',
16
+ "import/named": "off",
17
+ "@typescript-eslint/ban-ts-comment": ["error", { "ts-ignore": "allow-with-description" }],
18
+ "@typescript-eslint/member-delimiter-style": "warn",
19
+ "@typescript-eslint/type-annotation-spacing": ["error", {}],
20
+ "@typescript-eslint/consistent-type-imports": "warn",
21
+ "no-useless-constructor": "off",
22
+ indent: "off",
23
+ "@typescript-eslint/indent": [
24
+ "error",
30
25
  2,
31
26
  {
32
27
  SwitchCase: 1,
@@ -42,93 +37,93 @@ module.exports = {
42
37
  flatTernaryExpressions: false,
43
38
  ignoreComments: false,
44
39
  ignoredNodes: [
45
- 'TemplateLiteral *',
46
- 'JSXElement',
47
- 'JSXElement > *',
48
- 'JSXAttribute',
49
- 'JSXIdentifier',
50
- 'JSXNamespacedName',
51
- 'JSXMemberExpression',
52
- 'JSXSpreadAttribute',
53
- 'JSXExpressionContainer',
54
- 'JSXOpeningElement',
55
- 'JSXClosingElement',
56
- 'JSXFragment',
57
- 'JSXOpeningFragment',
58
- 'JSXClosingFragment',
59
- 'JSXText',
60
- 'JSXEmptyExpression',
61
- 'JSXSpreadChild',
62
- 'TSTypeParameterInstantiation'
40
+ "TemplateLiteral *",
41
+ "JSXElement",
42
+ "JSXElement > *",
43
+ "JSXAttribute",
44
+ "JSXIdentifier",
45
+ "JSXNamespacedName",
46
+ "JSXMemberExpression",
47
+ "JSXSpreadAttribute",
48
+ "JSXExpressionContainer",
49
+ "JSXOpeningElement",
50
+ "JSXClosingElement",
51
+ "JSXFragment",
52
+ "JSXOpeningFragment",
53
+ "JSXClosingFragment",
54
+ "JSXText",
55
+ "JSXEmptyExpression",
56
+ "JSXSpreadChild",
57
+ "TSTypeParameterInstantiation"
63
58
  ],
64
59
  offsetTernaryExpressions: true
65
60
  }
66
61
  ],
67
- 'no-unused-vars': 'off',
68
- '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
69
- 'no-redeclare': 'off',
70
- '@typescript-eslint/no-redeclare': 'error',
71
- 'no-use-before-define': 'off',
72
- '@typescript-eslint/no-use-before-define': [
73
- 'error',
62
+ "no-unused-vars": "off",
63
+ "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
64
+ "no-redeclare": "off",
65
+ "@typescript-eslint/no-redeclare": "error",
66
+ "no-use-before-define": "off",
67
+ "@typescript-eslint/no-use-before-define": [
68
+ "error",
74
69
  { functions: false, classes: false, variables: true }
75
70
  ],
76
- 'brace-style': 'off',
77
- '@typescript-eslint/brace-style': ['error', '1tbs', { allowSingleLine: true }],
78
- 'comma-dangle': 'off',
79
- '@typescript-eslint/comma-dangle': ['error', 'only-multiline'],
80
- 'object-curly-spacing': 'off',
81
- '@typescript-eslint/object-curly-spacing': ['error', 'always'],
82
- semi: 'off',
83
- '@typescript-eslint/semi': ['warn', 'always'],
84
- quotes: 'off',
85
- '@typescript-eslint/quotes': ['warn', 'single'],
86
- 'space-before-blocks': 'off',
87
- '@typescript-eslint/space-before-blocks': ['error', 'always'],
88
- 'space-before-function-paren': 'off',
89
- '@typescript-eslint/space-before-function-paren': [
90
- 'error',
71
+ "brace-style": "off",
72
+ "@typescript-eslint/brace-style": ["error", "1tbs", { allowSingleLine: true }],
73
+ "comma-dangle": "off",
74
+ "@typescript-eslint/comma-dangle": ["error", "only-multiline"],
75
+ "object-curly-spacing": "off",
76
+ "@typescript-eslint/object-curly-spacing": ["error", "always"],
77
+ semi: "off",
78
+ "@typescript-eslint/semi": ["warn", "always"],
79
+ quotes: "off",
80
+ "@typescript-eslint/quotes": ["warn", "double"],
81
+ "space-before-blocks": "off",
82
+ "@typescript-eslint/space-before-blocks": ["error", "always"],
83
+ "space-before-function-paren": "off",
84
+ "@typescript-eslint/space-before-function-paren": [
85
+ "error",
91
86
  {
92
- anonymous: 'always',
93
- named: 'never',
94
- asyncArrow: 'always'
87
+ anonymous: "always",
88
+ named: "never",
89
+ asyncArrow: "always"
95
90
  }
96
91
  ],
97
- 'space-infix-ops': 'off',
98
- '@typescript-eslint/space-infix-ops': 'error',
99
- 'keyword-spacing': 'off',
100
- '@typescript-eslint/keyword-spacing': ['error', { before: true, after: true }],
101
- 'comma-spacing': 'off',
102
- '@typescript-eslint/comma-spacing': ['error', { before: false, after: true }],
103
- 'no-extra-parens': 'off',
104
- '@typescript-eslint/no-extra-parens': ['error', 'functions'],
105
- 'no-dupe-class-members': 'off',
106
- '@typescript-eslint/no-dupe-class-members': 'error',
107
- 'no-loss-of-precision': 'off',
108
- '@typescript-eslint/no-loss-of-precision': 'error',
109
- 'lines-between-class-members': 'off',
110
- '@typescript-eslint/lines-between-class-members': [
111
- 'error',
112
- 'always',
92
+ "space-infix-ops": "off",
93
+ "@typescript-eslint/space-infix-ops": "error",
94
+ "keyword-spacing": "off",
95
+ "@typescript-eslint/keyword-spacing": ["error", { before: true, after: true }],
96
+ "comma-spacing": "off",
97
+ "@typescript-eslint/comma-spacing": ["error", { before: false, after: true }],
98
+ "no-extra-parens": "off",
99
+ "@typescript-eslint/no-extra-parens": ["error", "functions"],
100
+ "no-dupe-class-members": "off",
101
+ "@typescript-eslint/no-dupe-class-members": "error",
102
+ "no-loss-of-precision": "off",
103
+ "@typescript-eslint/no-loss-of-precision": "error",
104
+ "lines-between-class-members": "off",
105
+ "@typescript-eslint/lines-between-class-members": [
106
+ "error",
107
+ "always",
113
108
  { exceptAfterSingleLine: true }
114
109
  ],
115
- '@typescript-eslint/consistent-indexed-object-style': 'off',
116
- '@typescript-eslint/naming-convention': 'off',
117
- '@typescript-eslint/explicit-function-return-type': 'off',
118
- '@typescript-eslint/explicit-member-accessibility': 'off',
119
- '@typescript-eslint/no-explicit-any': 'off',
120
- '@typescript-eslint/parameter-properties': 'off',
121
- '@typescript-eslint/no-empty-interface': 'off',
122
- '@typescript-eslint/ban-ts-ignore': 'off',
123
- '@typescript-eslint/no-empty-function': 'off',
124
- '@typescript-eslint/no-non-null-assertion': 'off',
125
- '@typescript-eslint/explicit-module-boundary-types': 'off',
126
- '@typescript-eslint/ban-types': 'off',
127
- '@typescript-eslint/no-namespace': 'off',
128
- '@typescript-eslint/triple-slash-reference': 'off',
110
+ "@typescript-eslint/consistent-indexed-object-style": "off",
111
+ "@typescript-eslint/naming-convention": "off",
112
+ "@typescript-eslint/explicit-function-return-type": "off",
113
+ "@typescript-eslint/explicit-member-accessibility": "off",
114
+ "@typescript-eslint/no-explicit-any": "off",
115
+ "@typescript-eslint/parameter-properties": "off",
116
+ "@typescript-eslint/no-empty-interface": "off",
117
+ "@typescript-eslint/ban-ts-ignore": "off",
118
+ "@typescript-eslint/no-empty-function": "off",
119
+ "@typescript-eslint/no-non-null-assertion": "off",
120
+ "@typescript-eslint/explicit-module-boundary-types": "off",
121
+ "@typescript-eslint/ban-types": "off",
122
+ "@typescript-eslint/no-namespace": "off",
123
+ "@typescript-eslint/triple-slash-reference": "off",
129
124
 
130
125
  // REACT
131
- 'jsx-quotes': ['warn', 'prefer-double'],
132
- 'react/react-in-jsx-scope': 'off'
126
+ "jsx-quotes": ["warn", "prefer-double"],
127
+ "react/react-in-jsx-scope": "off"
133
128
  }
134
129
  };