@siberiacancode/eslint 1.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.
@@ -0,0 +1,99 @@
1
+ /** @type {import('eslint').Linter.Config} */
2
+ module.exports = {
3
+ env: {
4
+ browser: true,
5
+ es2021: true
6
+ },
7
+ extends: [
8
+ 'airbnb-base',
9
+ 'plugin:eslint-comments/recommended',
10
+ 'plugin:promise/recommended',
11
+ 'plugin:prettier/recommended'
12
+ ],
13
+ plugins: ['simple-import-sort', 'prettier'],
14
+ ignorePatterns: ['dist', 'coverage'],
15
+ parserOptions: {
16
+ ecmaVersion: 'latest',
17
+ sourceType: 'module'
18
+ },
19
+ rules: {
20
+ 'max-len': 'off',
21
+ 'consistent-return': 'off',
22
+ 'no-shadow': 'off',
23
+ 'no-param-reassign': 'warn',
24
+ 'no-console': ['warn', { allow: ['info', 'error'] }],
25
+ 'sort-imports': 'off',
26
+ 'import/order': 'off',
27
+ 'import/extensions': 'off',
28
+ 'import/prefer-default-export': 'off',
29
+ 'import/no-extraneous-dependencies': 'off',
30
+ 'simple-import-sort/exports': 'error',
31
+ 'simple-import-sort/imports': [
32
+ 'error',
33
+ {
34
+ groups: [
35
+ // External packages:
36
+ ['^react', '^@?\\w'],
37
+ // Internal packages:
38
+ ['^@(koronapay-core/.*|$)'],
39
+ // Alias imports:
40
+ ['^@(([\\/.]?\\w)|assets|test-utils)'],
41
+ // Side effect imports:
42
+ ['^\\u0000'],
43
+ // Parent imports:
44
+ ['^\\.\\.(?!/?$)', '^\\.\\./?$'],
45
+ // Other relative imports:
46
+ ['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
47
+ // Style imports:
48
+ ['^.+\\.s?css$']
49
+ ]
50
+ }
51
+ ],
52
+ 'require-await': 'error'
53
+ },
54
+ overrides: [
55
+ {
56
+ files: ['*.ts', '*.tsx'],
57
+ parser: '@typescript-eslint/parser',
58
+ parserOptions: {
59
+ project: './tsconfig.json'
60
+ },
61
+ extends: [
62
+ 'airbnb-typescript/base',
63
+ 'plugin:@typescript-eslint/recommended',
64
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
65
+ 'plugin:prettier/recommended'
66
+ ],
67
+ settings: {
68
+ 'import/parsers': {
69
+ '@typescript-eslint/parser': ['.ts', '.tsx']
70
+ },
71
+ 'import/resolver': {
72
+ typescript: {
73
+ project: './tsconfig.json'
74
+ }
75
+ }
76
+ },
77
+ rules: {
78
+ 'import/order': 'off',
79
+ 'import/extensions': 'off',
80
+ 'import/prefer-default-export': 'off',
81
+ 'import/no-extraneous-dependencies': 'off',
82
+ '@typescript-eslint/no-explicit-any': 'off',
83
+ '@typescript-eslint/no-unsafe-return': 'off',
84
+ '@typescript-eslint/ban-ts-comment': 'off',
85
+ '@typescript-eslint/no-shadow': 'off',
86
+ '@typescript-eslint/restrict-template-expressions': [
87
+ 'warn',
88
+ { allowBoolean: true, allowNullish: true }
89
+ ],
90
+ '@typescript-eslint/consistent-type-imports': [
91
+ 'error',
92
+ { prefer: 'type-imports', disallowTypeAnnotations: false }
93
+ ],
94
+ 'require-await': 'off',
95
+ '@typescript-eslint/require-await': 'error'
96
+ }
97
+ }
98
+ ]
99
+ };
@@ -0,0 +1,110 @@
1
+ /** @type {import('eslint').Linter.Config} */
2
+ module.exports = {
3
+ env: {
4
+ browser: true,
5
+ es2021: true
6
+ },
7
+ extends: [
8
+ 'airbnb',
9
+ 'airbnb/hooks',
10
+ 'plugin:eslint-comments/recommended',
11
+ 'plugin:promise/recommended',
12
+ 'plugin:prettier/recommended'
13
+ ],
14
+ plugins: ['simple-import-sort', 'prettier'],
15
+ ignorePatterns: ['dist', 'coverage'],
16
+ parserOptions: {
17
+ ecmaFeatures: { jsx: true },
18
+ ecmaVersion: 'latest',
19
+ sourceType: 'module'
20
+ },
21
+ rules: {
22
+ 'max-len': 'off',
23
+ 'consistent-return': 'off',
24
+ 'no-shadow': 'off',
25
+ 'no-param-reassign': 'warn',
26
+ 'no-template-curly-in-string': 'off',
27
+ 'no-console': ['warn', { allow: ['info', 'error'] }],
28
+ 'react/prop-types': 'off',
29
+ 'react/jsx-indent': 'off',
30
+ 'react/no-children-prop': 'off',
31
+ 'react/react-in-jsx-scope': 'off',
32
+ 'react/no-unused-prop-types': 'off',
33
+ 'react/require-default-props': 'off',
34
+ 'react/jsx-props-no-spreading': 'off',
35
+ 'react/button-has-type': 'warn',
36
+ 'react/no-array-index-key': 'warn',
37
+ 'react-hooks/exhaustive-deps': 'warn',
38
+ 'react/function-component-definition': [
39
+ 'error',
40
+ {
41
+ namedComponents: ['arrow-function'],
42
+ unnamedComponents: 'arrow-function'
43
+ }
44
+ ],
45
+ 'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
46
+ 'sort-imports': 'off',
47
+ 'import/order': 'off',
48
+ 'import/extensions': 'off',
49
+ 'import/prefer-default-export': 'off',
50
+ 'import/no-extraneous-dependencies': 'off',
51
+ 'simple-import-sort/exports': 'error',
52
+ 'simple-import-sort/imports': [
53
+ 'error',
54
+ {
55
+ groups: [
56
+ // External packages:
57
+ ['^react', '^@?\\w'],
58
+ // Internal packages:
59
+ ['^@(koronapay-core/.*|$)'],
60
+ // Alias imports:
61
+ ['^@(([\\/.]?\\w)|assets|test-utils)'],
62
+ // Side effect imports:
63
+ ['^\\u0000'],
64
+ // Parent imports:
65
+ ['^\\.\\.(?!/?$)', '^\\.\\./?$'],
66
+ // Other relative imports:
67
+ ['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
68
+ // Style imports:
69
+ ['^.+\\.s?css$']
70
+ ]
71
+ }
72
+ ],
73
+ 'require-await': 'error'
74
+ },
75
+ overrides: [
76
+ {
77
+ files: ['*.ts', '*.tsx'],
78
+ parser: '@typescript-eslint/parser',
79
+ parserOptions: {
80
+ project: './tsconfig.json'
81
+ },
82
+ extends: [
83
+ 'airbnb-typescript',
84
+ 'plugin:@typescript-eslint/recommended',
85
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
86
+ 'plugin:prettier/recommended'
87
+ ],
88
+ rules: {
89
+ 'import/order': 'off',
90
+ 'import/extensions': 'off',
91
+ 'import/prefer-default-export': 'off',
92
+ 'import/no-extraneous-dependencies': 'off',
93
+ '@typescript-eslint/no-explicit-any': 'off',
94
+ '@typescript-eslint/no-unsafe-return': 'off',
95
+ '@typescript-eslint/ban-ts-comment': 'off',
96
+ '@typescript-eslint/no-shadow': 'off',
97
+ '@typescript-eslint/restrict-template-expressions': [
98
+ 'warn',
99
+ { allowBoolean: true, allowNullish: true }
100
+ ],
101
+ '@typescript-eslint/consistent-type-imports': [
102
+ 'error',
103
+ { prefer: 'type-imports', disallowTypeAnnotations: false }
104
+ ],
105
+ 'require-await': 'off',
106
+ '@typescript-eslint/require-await': 'error'
107
+ }
108
+ }
109
+ ]
110
+ };
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # 🔮 eslint configs
2
+
3
+ Пакет содержит eslint-конфиги
package/index.js ADDED
@@ -0,0 +1,4 @@
1
+ const eslintReact = require('./.eslintrc.react.js');
2
+ const eslintNode = require('./.eslintrc.node.js');
3
+
4
+ module.exports = { eslint: { react: eslintReact, node: eslintNode } };
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@siberiacancode/eslint",
3
+ "description": "eslint configs",
4
+ "license": "MIT",
5
+ "version": "1.0.0",
6
+ "keywords": [
7
+ "eslint",
8
+ "react",
9
+ "node"
10
+ ],
11
+ "author": {
12
+ "name": "SIBERIA CAN CODE 🧊",
13
+ "url": "https://github.com/siberiacancode"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/siberiacancode/core/issues"
17
+ },
18
+ "homepage": "https://github.com/siberiacancode/@siberiacancode/eslint",
19
+ "repository": {
20
+ "url": "https://github.com/siberiacancode-core"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "files": [
26
+ ".eslintrc.node.js",
27
+ ".eslintrc.react.js"
28
+ ],
29
+ "main": "index.js",
30
+ "scripts": {
31
+ "format": "prettier --write \"*.js\""
32
+ },
33
+ "lint-staged": {
34
+ "*.js": "prettier --write"
35
+ },
36
+ "peerDependencies": {
37
+ "eslint": "^8.48.0"
38
+ },
39
+ "dependencies": {
40
+ "@typescript-eslint/eslint-plugin": "^6.6.0",
41
+ "@typescript-eslint/parser": "^6.6.0",
42
+ "eslint": "^8.48.0",
43
+ "eslint-config-airbnb": "^19.0.4",
44
+ "eslint-config-airbnb-typescript": "^17.1.0",
45
+ "eslint-config-prettier": "^9.0.0",
46
+ "eslint-import-resolver-typescript": "^3.6.0",
47
+ "eslint-plugin-eslint-comments": "^3.2.0",
48
+ "eslint-plugin-import": "^2.28.0",
49
+ "eslint-plugin-jsx-a11y": "^6.7.1",
50
+ "eslint-plugin-prettier": "^5.0.0",
51
+ "eslint-plugin-promise": "^6.1.1",
52
+ "eslint-plugin-react": "^7.33.2",
53
+ "eslint-plugin-react-hooks": "^4.6.0",
54
+ "eslint-plugin-simple-import-sort": "^10.0.0"
55
+ },
56
+ "devDependencies": {
57
+ "@siberiacancode/prettier": "*",
58
+ "eslint": "^8.2.0"
59
+ }
60
+ }