@stardustsorcery/eslint-config 0.0.0-stage → 0.1.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/base.js +41 -0
- package/nestjs.js +13 -0
- package/package.json +43 -3
- package/react.js +17 -0
- package/README.md +0 -3
package/base.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import js from '@eslint/js';
|
|
3
|
+
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
4
|
+
import {defineConfig} from 'eslint/config';
|
|
5
|
+
import tseslint from 'typescript-eslint';
|
|
6
|
+
|
|
7
|
+
export const baseConfig = defineConfig(
|
|
8
|
+
{
|
|
9
|
+
ignores: ['dist/**', 'build/**', 'coverage/**', '.turbo/**'],
|
|
10
|
+
},
|
|
11
|
+
js.configs.recommended,
|
|
12
|
+
...tseslint.configs.strictTypeChecked,
|
|
13
|
+
...tseslint.configs.stylisticTypeChecked,
|
|
14
|
+
{
|
|
15
|
+
languageOptions: {
|
|
16
|
+
parserOptions: {
|
|
17
|
+
projectService: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
'@typescript-eslint/no-unused-vars': [
|
|
22
|
+
'error',
|
|
23
|
+
{
|
|
24
|
+
argsIgnorePattern: '^_',
|
|
25
|
+
varsIgnorePattern: '^_',
|
|
26
|
+
caughtErrorsIgnorePattern: '^_',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
'@typescript-eslint/restrict-template-expressions': [
|
|
30
|
+
'error',
|
|
31
|
+
{allowNumber: true},
|
|
32
|
+
],
|
|
33
|
+
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
files: ['**/*.{js,mjs,cjs}'],
|
|
38
|
+
extends: [tseslint.configs.disableTypeChecked],
|
|
39
|
+
},
|
|
40
|
+
eslintConfigPrettier,
|
|
41
|
+
);
|
package/nestjs.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import {defineConfig} from 'eslint/config';
|
|
3
|
+
import globals from 'globals';
|
|
4
|
+
import {baseConfig} from './base.js';
|
|
5
|
+
|
|
6
|
+
export const nestConfig = defineConfig(...baseConfig, {
|
|
7
|
+
languageOptions: {
|
|
8
|
+
globals: globals.node,
|
|
9
|
+
},
|
|
10
|
+
rules: {
|
|
11
|
+
'@typescript-eslint/no-extraneous-class': 'off',
|
|
12
|
+
},
|
|
13
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stardustsorcery/eslint-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared ESLint Flat Config presets for TypeScript, React, and NestJS",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/StardustSorcery/development-utilities.git",
|
|
10
|
+
"directory": "typescript/packages/eslint-config"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"base.js",
|
|
17
|
+
"react.js",
|
|
18
|
+
"nestjs.js"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
"./base": "./base.js",
|
|
22
|
+
"./react": "./react.js",
|
|
23
|
+
"./nestjs": "./nestjs.js"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@eslint/js": "^10.0.1",
|
|
27
|
+
"eslint-config-prettier": "^10.1.8",
|
|
28
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
29
|
+
"eslint-plugin-react-refresh": "^0.5.8",
|
|
30
|
+
"globals": "^17.14.0",
|
|
31
|
+
"typescript-eslint": "^8.73.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"eslint": "^10.0.0",
|
|
35
|
+
"typescript": ">=5.8.0 <6.1.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@stardustsorcery/tsconfig": "0.1.0",
|
|
39
|
+
"eslint": "^10.15.0",
|
|
40
|
+
"typescript": "^6.0.3"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"lint": "eslint .",
|
|
44
|
+
"typecheck": "tsc --noEmit"
|
|
45
|
+
}
|
|
6
46
|
}
|
package/react.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import {defineConfig} from 'eslint/config';
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
+
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
5
|
+
import globals from 'globals';
|
|
6
|
+
import {baseConfig} from './base.js';
|
|
7
|
+
|
|
8
|
+
export const reactConfig = defineConfig(
|
|
9
|
+
...baseConfig,
|
|
10
|
+
{
|
|
11
|
+
languageOptions: {
|
|
12
|
+
globals: globals.browser,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
reactHooks.configs.flat.recommended,
|
|
16
|
+
reactRefresh.configs.vite,
|
|
17
|
+
);
|
package/README.md
DELETED