@skilbjo/config-rc 1.0.15 → 1.0.16

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/.depcheckrc CHANGED
@@ -3,5 +3,9 @@ ignores: [
3
3
  '@commitlint/config-angular',
4
4
  '@tsconfig/node18',
5
5
  '@types/jest',
6
- 'husky'
6
+ 'husky',
7
+ 'eslint-import-resolver-typescript',
8
+ 'eslint-plugin-n',
9
+ 'eslint-plugin-security',
10
+ 'typescript',
7
11
  ]
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.0.16](https://github.com/skilbjo/config-rc/compare/v1.0.15...v1.0.16) (2024-10-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * eslint@9 ([#166](https://github.com/skilbjo/config-rc/issues/166)) ([72cdf4b](https://github.com/skilbjo/config-rc/commit/72cdf4b428954a701680199881df374b00f5f46e))
7
+
1
8
  ## [1.0.15](https://github.com/skilbjo/config-rc/compare/v1.0.14...v1.0.15) (2024-10-15)
2
9
 
3
10
 
@@ -0,0 +1,121 @@
1
+ /* eslint-disable @typescript-eslint/no-require-imports, n/no-unpublished-require */
2
+ const path = require('path');
3
+ const { fixupConfigRules, fixupPluginRules } = require('@eslint/compat');
4
+ const { FlatCompat } = require('@eslint/eslintrc');
5
+ const js = require('@eslint/js');
6
+ const typescriptEslint = require('@typescript-eslint/eslint-plugin');
7
+ const tsParser = require('@typescript-eslint/parser');
8
+ const _import = require('eslint-plugin-import');
9
+ const jest = require('eslint-plugin-jest');
10
+ const perfectionist = require('eslint-plugin-perfectionist');
11
+ const prettier = require('eslint-plugin-prettier');
12
+ const globals = require('globals');
13
+
14
+ const compat = new FlatCompat({
15
+ allConfig: js.configs.all,
16
+ baseDirectory: __dirname,
17
+ recommendedConfig: js.configs.recommended,
18
+ });
19
+
20
+ module.exports = [
21
+ ...fixupConfigRules(
22
+ compat.extends(
23
+ 'prettier',
24
+ 'eslint:recommended',
25
+ 'plugin:@typescript-eslint/recommended',
26
+ 'plugin:@typescript-eslint/strict',
27
+ 'plugin:import/recommended',
28
+ 'plugin:import/typescript',
29
+ 'plugin:n/recommended',
30
+ 'plugin:prettier/recommended',
31
+ 'plugin:security/recommended-legacy',
32
+ 'plugin:perfectionist/recommended-alphabetical-legacy'
33
+ )
34
+ ),
35
+ {
36
+ files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.cjs'],
37
+ languageOptions: {
38
+ ecmaVersion: 2022,
39
+ globals: {
40
+ ...jest.environments.globals.globals,
41
+ ...globals.node,
42
+ Atomics: 'readonly',
43
+ SharedArrayBuffer: 'readonly',
44
+ },
45
+ parser: tsParser,
46
+ parserOptions: {
47
+ project: path.resolve(__dirname, './tsconfig.json'),
48
+ sourceType: 'module',
49
+ tsconfigRootDir: __dirname,
50
+ },
51
+ sourceType: 'module',
52
+ },
53
+ linterOptions: {
54
+ reportUnusedDisableDirectives: true,
55
+ },
56
+ plugins: {
57
+ '@typescript-eslint': fixupPluginRules(typescriptEslint),
58
+ import: fixupPluginRules(_import),
59
+ jest,
60
+ perfectionist: fixupPluginRules(perfectionist),
61
+ prettier: fixupPluginRules(prettier),
62
+ },
63
+ rules: {
64
+ '@typescript-eslint/consistent-type-definitions': ['error', 'type'],
65
+ '@typescript-eslint/no-floating-promises': 'error',
66
+ '@typescript-eslint/no-misused-promises': 'error',
67
+ '@typescript-eslint/no-non-null-assertion': 1,
68
+ '@typescript-eslint/no-unused-vars': 1,
69
+ eqeqeq: 2,
70
+ 'import/default': 2,
71
+ 'import/export': 2,
72
+ 'import/named': 2,
73
+ 'import/namespace': 2,
74
+ 'import/newline-after-import': 2,
75
+ 'import/no-duplicates': 2,
76
+ 'import/no-unresolved': 2,
77
+ 'import/order': 2,
78
+ 'n/no-missing-import': 'off',
79
+ 'n/no-unsupported-features/es-syntax': 'off',
80
+ 'n/shebang': 'off',
81
+ 'no-multiple-empty-lines': [
82
+ 2,
83
+ {
84
+ max: 1,
85
+ maxEOF: 0,
86
+ },
87
+ ],
88
+ 'perfectionist/sort-exports': 'off',
89
+ 'perfectionist/sort-imports': 'off',
90
+ 'prettier/prettier': [
91
+ 'error',
92
+ {
93
+ arrowParens: 'always',
94
+ printWidth: 80,
95
+ semi: true,
96
+ singleQuote: true,
97
+ tabWidth: 2,
98
+ trailingComma: 'es5',
99
+ },
100
+ ],
101
+ 'security/detect-object-injection': 'off',
102
+ },
103
+ settings: {
104
+ 'import/parsers': {
105
+ '@typescript-eslint/parser': ['.ts', '.js'],
106
+ },
107
+ 'import/resolver': {
108
+ node: {
109
+ extensions: ['.ts', '.js'],
110
+ },
111
+ typescript: {
112
+ alwaysTryTypes: true,
113
+ },
114
+ },
115
+ node: {
116
+ resolvePaths: ['node_modules/@types'],
117
+ tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts'],
118
+ },
119
+ },
120
+ },
121
+ ];
package/index.js CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  // const require = createRequire(import.meta.url);
4
4
 
5
- const eslintrc = require('./.eslintrc.cjs'); // eslint-disable-line @typescript-eslint/no-var-requires, n/no-missing-require
5
+ const eslintrc = require('./.eslintrc.cjs'); // eslint-disable-line @typescript-eslint/no-require-imports, n/no-missing-require
6
6
 
7
7
  module.exports = eslintrc;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@skilbjo/config-rc",
4
- "version": "1.0.15",
4
+ "version": "1.0.16",
5
5
  "description": "eslint, prettier, & tsconfig config",
6
6
  "main": "index.js",
7
7
  "scripts": {
@@ -22,13 +22,15 @@
22
22
  },
23
23
  "homepage": "https://github.com/skilbjo/config-rc#readme",
24
24
  "dependencies": {
25
+ "@eslint/compat": "1.2.0",
26
+ "@eslint/eslintrc": "3.1.0",
27
+ "@eslint/js": "9.12.0",
25
28
  "@tsconfig/node20": "20.1.4",
26
29
  "@types/jest": "29.5.12",
27
- "@typescript-eslint/eslint-plugin": "7.17.0",
28
- "@typescript-eslint/parser": "7.18.0",
29
- "eslint": "8.57.0",
30
+ "@typescript-eslint/eslint-plugin": "8.8.0",
31
+ "@typescript-eslint/parser": "8.8.0",
32
+ "eslint": "9.12.0",
30
33
  "eslint-config-prettier": "9.1.0",
31
- "eslint-config-typescript": "3.0.0",
32
34
  "eslint-import-resolver-typescript": "3.6.3",
33
35
  "eslint-plugin-import": "2.31.0",
34
36
  "eslint-plugin-jest": "28.8.3",
@@ -36,6 +38,7 @@
36
38
  "eslint-plugin-perfectionist": "3.8.0",
37
39
  "eslint-plugin-prettier": "5.2.1",
38
40
  "eslint-plugin-security": "3.0.1",
41
+ "globals": "15.11.0",
39
42
  "prettier": "3.3.3",
40
43
  "typescript": "5.6.3"
41
44
  },
@@ -52,7 +55,7 @@
52
55
  ]
53
56
  },
54
57
  "engines": {
55
- "node": ">=16.0.0"
58
+ "node": ">=20.0.0"
56
59
  },
57
60
  "publishConfig": {
58
61
  "registry": "https://registry.npmjs.org/"
package/tsconfig.json CHANGED
@@ -11,6 +11,7 @@
11
11
  "ES2023"
12
12
  ],
13
13
 
14
+ "allowJs": true,
14
15
  "outDir": "dist",
15
16
  "declaration": true,
16
17
  "forceConsistentCasingInFileNames": true,
@@ -32,6 +33,7 @@
32
33
  "src/**/*.ts",
33
34
  "test/**/*.ts",
34
35
  ".eslintrc.cjs",
36
+ "eslint.config.cjs",
35
37
  "index.js"
36
38
  ],
37
39
  "exclude": [
package/.eslintrc.cjs DELETED
@@ -1,87 +0,0 @@
1
- module.exports = {
2
- env: {
3
- es6: true,
4
- 'jest/globals': true,
5
- node: true,
6
- },
7
- extends: [
8
- 'prettier',
9
- 'typescript',
10
- 'eslint:recommended',
11
- 'plugin:@typescript-eslint/recommended',
12
- 'plugin:@typescript-eslint/strict',
13
- 'plugin:import/recommended',
14
- 'plugin:import/typescript',
15
- 'plugin:n/recommended',
16
- 'plugin:prettier/recommended',
17
- 'plugin:security/recommended-legacy',
18
- 'plugin:perfectionist/recommended-alphabetical-legacy',
19
- ],
20
- globals: {
21
- Atomics: 'readonly',
22
- SharedArrayBuffer: 'readonly',
23
- },
24
- parser: '@typescript-eslint/parser',
25
- parserOptions: {
26
- ecmaVersion: 2022,
27
- project: './tsconfig.json',
28
- sourceType: 'module',
29
- },
30
- plugins: [
31
- '@typescript-eslint',
32
- 'import',
33
- 'jest',
34
- 'prettier',
35
- 'perfectionist',
36
- ],
37
- reportUnusedDisableDirectives: true,
38
- rules: {
39
- '@typescript-eslint/consistent-type-definitions': ['error', 'type'],
40
- '@typescript-eslint/no-floating-promises': 'error',
41
- '@typescript-eslint/no-misused-promises': 'error',
42
- '@typescript-eslint/no-non-null-assertion': 1,
43
- '@typescript-eslint/no-unused-vars': 1,
44
- eqeqeq: 2,
45
- 'import/default': 2,
46
- 'import/export': 2,
47
- 'import/named': 2,
48
- 'import/namespace': 2,
49
- 'import/newline-after-import': 2,
50
- 'import/no-duplicates': 2,
51
- 'import/no-unresolved': 2,
52
- 'import/order': 2,
53
- 'n/no-missing-import': 'off', // conflicts with typescript absolute imports
54
- 'n/no-unsupported-features/es-syntax': 'off',
55
- 'n/shebang': 'off',
56
- 'no-multiple-empty-lines': [2, { max: 1, maxEOF: 0 }],
57
- 'perfectionist/sort-exports': 'off',
58
- 'perfectionist/sort-imports': 'off',
59
- 'prettier/prettier': [
60
- 'error',
61
- {
62
- arrowParens: 'always',
63
- printWidth: 80,
64
- semi: true,
65
- singleQuote: true,
66
- tabWidth: 2,
67
- trailingComma: 'es5',
68
- },
69
- ],
70
- 'security/detect-object-injection': 'off',
71
- },
72
- settings: {
73
- 'import/parsers': {
74
- '@typescript-eslint/parser': ['.ts'],
75
- },
76
- 'import/resolver': {
77
- node: { extensions: ['.ts', '.js'] }, // leave this
78
- typescript: {
79
- alwaysTryTypes: true,
80
- },
81
- },
82
- node: {
83
- resolvePaths: ['node_modules/@types'],
84
- tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts'],
85
- },
86
- },
87
- };