@aliexme/eslint-config 0.4.2 → 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.
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import recommendedConfigArray from './configs/recommended.js';
2
+ export default recommendedConfigArray;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,MAAM,0BAA0B,CAAA;AAE7D,eAAe,sBAAoD,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { FlatCompat } from '@eslint/eslintrc';
2
+ export declare const compat: FlatCompat;
@@ -0,0 +1,3 @@
1
+ import { FlatCompat } from '@eslint/eslintrc';
2
+ export const compat = new FlatCompat();
3
+ //# sourceMappingURL=compat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compat.js","sourceRoot":"","sources":["../../src/utils/compat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aliexme/eslint-config",
3
- "version": "0.4.2",
4
- "description": "Rule set for ESLint",
3
+ "version": "1.0.0",
4
+ "description": "Set of configs for ESLint",
5
5
  "private": false,
6
6
  "author": "Alexander Smirnov <al.smirnov996@gmail.com>",
7
7
  "homepage": "https://github.com/aliexme/web-shared/tree/main/packages/eslint-config",
@@ -15,41 +15,44 @@
15
15
  "eslint",
16
16
  "eslintconfig"
17
17
  ],
18
+ "type": "module",
18
19
  "files": [
19
- "./index.js",
20
- "./rules/**"
20
+ "dist"
21
21
  ],
22
22
  "exports": {
23
- ".": "./index.js",
24
- "./base": "./rules/base.js",
25
- "./import": "./rules/import.js",
26
- "./typescript": "./rules/typescript.js",
27
- "./react": "./rules/react.js",
28
- "./react-native": "./rules/react-native.js",
29
- "./prettier": "./rules/prettier.js"
23
+ ".": "./dist/index.js",
24
+ "./base": "./dist/configs/base.js",
25
+ "./typescript": "./dist/configs/typescript.js",
26
+ "./import": "./dist/configs/import.js",
27
+ "./react": "./dist/configs/react.js",
28
+ "./react-native": "./dist/configs/react-native.js",
29
+ "./prettier": "./dist/configs/prettier.js",
30
+ "./recommended": "./dist/configs/recommended.js"
30
31
  },
31
32
  "publishConfig": {
32
33
  "access": "public"
33
34
  },
35
+ "scripts": {
36
+ "build": "tsc -p ./tsconfig.build.json"
37
+ },
38
+ "dependencies": {
39
+ "@eslint/compat": "1.1.0",
40
+ "@eslint/eslintrc": "3.1.0",
41
+ "@eslint/js": "9.6.0",
42
+ "eslint-plugin-import": "2.29.1",
43
+ "globals": "15.8.0",
44
+ "typescript-eslint": "7.15.0"
45
+ },
34
46
  "peerDependencies": {
35
- "@typescript-eslint/eslint-plugin": "^6.7.3",
36
- "@typescript-eslint/parser": "^6.7.3",
37
- "eslint": "^8.50.0",
47
+ "eslint": "^9.0.0",
38
48
  "eslint-config-prettier": "^9.0.0",
39
- "eslint-plugin-import": "^2.28.1",
40
49
  "eslint-plugin-prettier": "^5.0.0",
41
- "eslint-plugin-react": "^7.33.2",
42
- "eslint-plugin-react-hooks": "^4.6.0",
43
- "eslint-plugin-react-native": "^4.1.0",
44
- "prettier": "^3.0.3"
50
+ "eslint-plugin-react": "^7.0.0",
51
+ "eslint-plugin-react-hooks": "^4.0.0",
52
+ "eslint-plugin-react-native": "^4.0.0",
53
+ "prettier": "^3.0.0"
45
54
  },
46
55
  "peerDependenciesMeta": {
47
- "@typescript-eslint/eslint-plugin": {
48
- "optional": true
49
- },
50
- "@typescript-eslint/parser": {
51
- "optional": true
52
- },
53
56
  "eslint-config-prettier": {
54
57
  "optional": true
55
58
  },
@@ -69,5 +72,5 @@
69
72
  "optional": true
70
73
  }
71
74
  },
72
- "gitHead": "609a61577aa1c248600a6b8d875d3a1d7792da6f"
75
+ "gitHead": "58d3f218e0a47f3d1082272f8b12276c7e2e5b93"
73
76
  }
package/index.js DELETED
@@ -1,4 +0,0 @@
1
- /** @type {import('eslint').ESLint.ConfigData} */
2
- module.exports = {
3
- extends: ['./rules/base.js', './rules/import.js'],
4
- }
package/rules/base.js DELETED
@@ -1,122 +0,0 @@
1
- /** @type {import('eslint').ESLint.ConfigData} */
2
- module.exports = {
3
- parserOptions: {
4
- ecmaVersion: 'latest',
5
- sourceType: 'module',
6
- },
7
- env: {
8
- browser: true,
9
- node: true,
10
- es6: true,
11
- },
12
- extends: ['eslint:recommended'],
13
- rules: {
14
- quotes: ['error', 'single'],
15
- 'jsx-quotes': ['error', 'prefer-single'],
16
- 'quote-props': ['error', 'as-needed'],
17
- semi: ['error', 'never'],
18
- indent: ['error', 2, { SwitchCase: 1 }],
19
- 'max-len': ['error', 120],
20
- 'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0, maxBOF: 0 }],
21
- 'comma-dangle': ['error', 'always-multiline'],
22
- 'comma-spacing': ['error', { before: false, after: true }],
23
- 'comma-style': ['error', 'last'],
24
- 'key-spacing': 'error',
25
- 'keyword-spacing': ['error', { before: true, after: true }],
26
- 'object-curly-spacing': ['error', 'always'],
27
- 'array-bracket-spacing': ['error', 'never'],
28
- 'computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }],
29
- 'arrow-spacing': 'error',
30
- 'switch-colon-spacing': ['error', { after: true, before: false }],
31
- 'space-in-parens': ['error', 'never'],
32
- 'space-before-function-paren': [
33
- 'error',
34
- {
35
- anonymous: 'never',
36
- named: 'never',
37
- asyncArrow: 'always',
38
- },
39
- ],
40
- 'space-before-blocks': ['error', 'always'],
41
- 'no-constant-condition': ['error', { checkLoops: false }],
42
- 'no-trailing-spaces': 'error',
43
- 'no-multi-spaces': 'error',
44
- 'eol-last': 'error',
45
- 'arrow-parens': 'error',
46
- 'no-useless-rename': 'error',
47
- 'no-var': 'error',
48
- 'prefer-const': 'error',
49
- 'no-new-object': 'error',
50
- 'object-shorthand': 'error',
51
- 'prefer-object-spread': 'error',
52
- 'no-array-constructor': 'error',
53
- 'array-callback-return': ['error', { checkForEach: true }],
54
- 'prefer-destructuring': ['error', { array: false, object: true }, { enforceForRenamedProperties: false }],
55
- 'prefer-template': 'error',
56
- 'template-curly-spacing': ['error', 'never'],
57
- 'no-eval': 'error',
58
- 'wrap-iife': ['error', 'inside', { functionPrototypeMethods: true }],
59
- 'no-loop-func': 'error',
60
- 'prefer-rest-params': 'error',
61
- 'default-param-last': 'error',
62
- 'no-new-func': 'error',
63
- 'no-param-reassign': ['error', { props: true }],
64
- 'prefer-spread': 'error',
65
- 'space-infix-ops': ['error', { int32Hint: true }],
66
- 'function-paren-newline': ['error', 'multiline-arguments'],
67
- 'object-curly-newline': ['error', { consistent: true }],
68
- 'prefer-arrow-callback': 'error',
69
- 'no-empty-function': 'error',
70
- 'no-useless-constructor': 'error',
71
- 'dot-notation': 'error',
72
- 'one-var': ['error', 'never'],
73
- 'no-multi-assign': 'error',
74
- 'operator-linebreak': [
75
- 'error',
76
- 'before',
77
- {
78
- overrides: { '=': 'after' },
79
- },
80
- ],
81
- eqeqeq: 'error',
82
- 'no-unneeded-ternary': ['error', { defaultAssignment: false }],
83
- 'no-nested-ternary': 'error',
84
- 'no-mixed-operators': 'error',
85
- 'brace-style': ['error', '1tbs'],
86
- 'spaced-comment': [
87
- 'error',
88
- 'always',
89
- {
90
- markers: ['/', '!', '?'],
91
- },
92
- ],
93
- 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 2 }],
94
- 'no-whitespace-before-property': 'error',
95
- 'padded-blocks': ['error', 'never'],
96
- 'block-spacing': ['error', 'always'],
97
- 'func-call-spacing': ['error', 'never'],
98
- 'no-new-wrappers': 'error',
99
- radix: ['error', 'as-needed'],
100
- 'id-length': [
101
- 'error',
102
- {
103
- min: 2,
104
- exceptions: ['_', 'i', 'e'],
105
- exceptionPatterns: ['[x-z]'],
106
- },
107
- ],
108
- 'new-cap': 'error',
109
- 'no-restricted-globals': [
110
- 'error',
111
- {
112
- name: 'isNaN',
113
- message: 'Use Number.isNaN instead.',
114
- },
115
- {
116
- name: 'isFinite',
117
- message: 'Use Number.isFinite instead.',
118
- },
119
- ],
120
- 'no-console': 'warn',
121
- },
122
- }
package/rules/import.js DELETED
@@ -1,31 +0,0 @@
1
- /** @type {import('eslint').ESLint.ConfigData} */
2
- module.exports = {
3
- plugins: ['import'],
4
- extends: ['plugin:import/recommended'],
5
- settings: {
6
- 'import/resolver': {
7
- node: {
8
- extensions: ['.js', '.cjs', '.mjs', '.jsx', '.ts', '.tsx'],
9
- moduleDirectory: ['src/', 'node_modules'],
10
- },
11
- },
12
- 'import/ignore': ['node_modules'],
13
- },
14
- rules: {
15
- 'import/no-useless-path-segments': ['error', { noUselessIndex: false }],
16
- 'import/order': [
17
- 'error',
18
- {
19
- groups: [['builtin', 'external'], 'internal', ['parent', 'sibling'], 'index', 'object'],
20
- 'newlines-between': 'always',
21
- warnOnUnassignedImports: true,
22
- },
23
- ],
24
- 'import/no-duplicates': ['error', { 'prefer-inline': true }],
25
- 'import/no-self-import': 'error',
26
- 'import/no-mutable-exports': 'error',
27
- 'import/first': 'error',
28
- 'import/newline-after-import': 'error',
29
- 'import/namespace': 'off',
30
- },
31
- }
package/rules/prettier.js DELETED
@@ -1,8 +0,0 @@
1
- /** @type {import('eslint').ESLint.ConfigData} */
2
- module.exports = {
3
- plugins: ['prettier'],
4
- extends: ['prettier'],
5
- rules: {
6
- 'prettier/prettier': 'error',
7
- },
8
- }
@@ -1,24 +0,0 @@
1
- /** @type {import('eslint').ESLint.ConfigData} */
2
- module.exports = {
3
- env: {
4
- 'react-native/react-native': true,
5
- },
6
- plugins: ['react-native'],
7
- extends: ['plugin:import/react-native'],
8
- rules: {
9
- 'react-native/no-unused-styles': 'error',
10
- 'react-native/no-inline-styles': 'error',
11
- 'react-native/no-raw-text': ['error', { skip: ['Text', 'Button'] }],
12
- 'react-native/no-single-element-style-arrays': 'error',
13
- },
14
- overrides: [
15
- {
16
- files: ['**/*.{jsx,tsx}'],
17
- parserOptions: {
18
- ecmaFeatures: {
19
- jsx: true,
20
- },
21
- },
22
- },
23
- ],
24
- }
package/rules/react.js DELETED
@@ -1,43 +0,0 @@
1
- /** @type {import('eslint').ESLint.ConfigData} */
2
- module.exports = {
3
- plugins: ['react'],
4
- extends: ['plugin:import/react', 'plugin:react/recommended', 'plugin:react/jsx-runtime'],
5
- settings: {
6
- react: {
7
- version: 'detect',
8
- },
9
- },
10
- rules: {
11
- 'react/jsx-tag-spacing': [
12
- 'error',
13
- {
14
- closingSlash: 'never',
15
- beforeSelfClosing: 'proportional-always',
16
- afterOpening: 'never',
17
- beforeClosing: 'never',
18
- },
19
- ],
20
- 'react/jsx-max-props-per-line': ['error', { when: 'multiline' }],
21
- 'react/jsx-curly-spacing': ['error', { when: 'never', children: true }],
22
- 'react/jsx-curly-brace-presence': ['error', 'never'],
23
- 'react/jsx-closing-bracket-location': 'error',
24
- 'react/self-closing-comp': 'error',
25
- 'react/no-unused-prop-types': 'error',
26
- },
27
- overrides: [
28
- {
29
- files: ['**/*.{jsx,tsx}'],
30
- parserOptions: {
31
- ecmaFeatures: {
32
- jsx: true,
33
- },
34
- },
35
- },
36
- {
37
- files: ['**/*.tsx'],
38
- rules: {
39
- 'react/prop-types': 'off',
40
- },
41
- },
42
- ],
43
- }
@@ -1,39 +0,0 @@
1
- /** @type {import('eslint').ESLint.ConfigData} */
2
- module.exports = {
3
- overrides: [
4
- {
5
- files: ['**/*.{ts,tsx}'],
6
- parser: '@typescript-eslint/parser',
7
- plugins: ['@typescript-eslint'],
8
- extends: ['plugin:import/typescript', 'plugin:@typescript-eslint/recommended'],
9
- rules: {
10
- '@typescript-eslint/naming-convention': [
11
- 'error',
12
- {
13
- selector: 'enumMember',
14
- format: ['UPPER_CASE', 'PascalCase'],
15
- },
16
- ],
17
- '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
18
- '@typescript-eslint/member-delimiter-style': [
19
- 'error',
20
- {
21
- multiline: { delimiter: 'none' },
22
- singleline: { delimiter: 'comma' },
23
- },
24
- ],
25
- '@typescript-eslint/no-empty-interface': [
26
- 'error',
27
- {
28
- allowSingleExtends: true,
29
- },
30
- ],
31
- '@typescript-eslint/consistent-type-imports': [
32
- 'error',
33
- { prefer: 'type-imports', fixStyle: 'inline-type-imports' },
34
- ],
35
- '@typescript-eslint/type-annotation-spacing': 'error',
36
- },
37
- },
38
- ],
39
- }