@ixo/eslint-config 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/README.md +3 -0
- package/base.js +75 -0
- package/library.js +29 -0
- package/nest.js +25 -0
- package/next.js +44 -0
- package/package.json +26 -0
- package/prettier-base.js +8 -0
- package/react-internal.js +34 -0
package/README.md
ADDED
package/base.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const { resolve } = require('node:path');
|
|
2
|
+
|
|
3
|
+
const project = resolve(process.cwd(), 'tsconfig.json');
|
|
4
|
+
|
|
5
|
+
/** @type {import("eslint").Linter.Config} */
|
|
6
|
+
module.exports = {
|
|
7
|
+
root: true,
|
|
8
|
+
extends: [
|
|
9
|
+
'plugin:@typescript-eslint/recommended',
|
|
10
|
+
'plugin:prettier/recommended',
|
|
11
|
+
'prettier',
|
|
12
|
+
'turbo',
|
|
13
|
+
require.resolve('@vercel/style-guide/eslint/node'),
|
|
14
|
+
require.resolve('@vercel/style-guide/eslint/typescript'),
|
|
15
|
+
'eslint-config-turbo',
|
|
16
|
+
],
|
|
17
|
+
rules: {
|
|
18
|
+
'@typescript-eslint/array-type': 'off',
|
|
19
|
+
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
20
|
+
'import/no-extraneous-dependencies': 'off',
|
|
21
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
22
|
+
'warn',
|
|
23
|
+
{
|
|
24
|
+
prefer: 'type-imports',
|
|
25
|
+
fixStyle: 'inline-type-imports',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
'@typescript-eslint/no-unused-vars': [
|
|
29
|
+
'warn',
|
|
30
|
+
{
|
|
31
|
+
argsIgnorePattern: '^_',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
'@typescript-eslint/require-await': 'off',
|
|
35
|
+
'@typescript-eslint/no-misused-promises': [
|
|
36
|
+
'error',
|
|
37
|
+
{
|
|
38
|
+
checksVoidReturn: {
|
|
39
|
+
attributes: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
'import/order': 'off',
|
|
44
|
+
'no-console': 'warn',
|
|
45
|
+
'@typescript-eslint/no-dynamic-delete': 'off',
|
|
46
|
+
/** no-undef is not useful for typescript already typescript checks and this rule will error on any global interface in any declaration file */
|
|
47
|
+
'no-undef': 'off',
|
|
48
|
+
'import/named': 'off',
|
|
49
|
+
'import/no-default-export': 'off',
|
|
50
|
+
'object-shorthand': 'error',
|
|
51
|
+
'@typescript-eslint/naming-convention': [
|
|
52
|
+
'error',
|
|
53
|
+
{
|
|
54
|
+
selector: 'interface',
|
|
55
|
+
format: ['PascalCase'],
|
|
56
|
+
custom: {
|
|
57
|
+
regex: '^I[A-Z]',
|
|
58
|
+
match: true,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
plugins: ['@typescript-eslint/eslint-plugin'],
|
|
64
|
+
parser: '@typescript-eslint/parser',
|
|
65
|
+
ignorePatterns: [
|
|
66
|
+
'.*.js',
|
|
67
|
+
'*.setup.js',
|
|
68
|
+
'*.config.js',
|
|
69
|
+
'.turbo/',
|
|
70
|
+
'dist/',
|
|
71
|
+
'coverage/',
|
|
72
|
+
'node_modules/',
|
|
73
|
+
'**/gql/generated/**',
|
|
74
|
+
],
|
|
75
|
+
};
|
package/library.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const { resolve } = require('node:path');
|
|
2
|
+
|
|
3
|
+
const project = resolve(process.cwd(), 'tsconfig.json');
|
|
4
|
+
|
|
5
|
+
/** @type {import("eslint").Linter.Config} */
|
|
6
|
+
module.exports = {
|
|
7
|
+
extends: ['./base.js'],
|
|
8
|
+
plugins: ['only-warn'],
|
|
9
|
+
globals: {
|
|
10
|
+
React: true,
|
|
11
|
+
JSX: true,
|
|
12
|
+
},
|
|
13
|
+
env: {
|
|
14
|
+
node: true,
|
|
15
|
+
},
|
|
16
|
+
settings: {
|
|
17
|
+
'import/resolver': {
|
|
18
|
+
typescript: {
|
|
19
|
+
project,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
ignorePatterns: ['.*.js', 'node_modules/', 'dist/'],
|
|
24
|
+
overrides: [
|
|
25
|
+
{
|
|
26
|
+
files: ['*.js?(x)', '*.ts?(x)'],
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
package/nest.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { resolve } = require('node:path');
|
|
2
|
+
|
|
3
|
+
const project = resolve(process.cwd(), 'tsconfig.json');
|
|
4
|
+
|
|
5
|
+
/** @type {import("eslint").Linter.Config} */
|
|
6
|
+
module.exports = {
|
|
7
|
+
extends: ['./base.js'],
|
|
8
|
+
rules: {
|
|
9
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
10
|
+
'@typescript-eslint/no-extraneous-class': 'warn',
|
|
11
|
+
},
|
|
12
|
+
overrides: [
|
|
13
|
+
{
|
|
14
|
+
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
15
|
+
extends: [require.resolve('@vercel/style-guide/eslint/jest')],
|
|
16
|
+
rules: {
|
|
17
|
+
'jest/prefer-lowercase-title': 'off',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
env: {
|
|
22
|
+
node: true,
|
|
23
|
+
jest: true,
|
|
24
|
+
},
|
|
25
|
+
};
|
package/next.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const { resolve } = require('node:path');
|
|
2
|
+
|
|
3
|
+
const project = resolve(process.cwd(), 'tsconfig.json');
|
|
4
|
+
|
|
5
|
+
/** @type {import("eslint").Linter.Config} */
|
|
6
|
+
module.exports = {
|
|
7
|
+
extends: ['./base.js', require.resolve('@vercel/style-guide/eslint/next')],
|
|
8
|
+
globals: {
|
|
9
|
+
React: true,
|
|
10
|
+
JSX: true,
|
|
11
|
+
},
|
|
12
|
+
env: {
|
|
13
|
+
node: true,
|
|
14
|
+
browser: true,
|
|
15
|
+
},
|
|
16
|
+
plugins: ['only-warn'],
|
|
17
|
+
settings: {
|
|
18
|
+
'import/resolver': {
|
|
19
|
+
typescript: {
|
|
20
|
+
project,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
overrides: [
|
|
25
|
+
{
|
|
26
|
+
files: ['*.js?(x)', '*.ts?(x)'],
|
|
27
|
+
rules: {
|
|
28
|
+
'@typescript-eslint/restrict-template-expressions': [
|
|
29
|
+
'error',
|
|
30
|
+
{
|
|
31
|
+
allowAny: false,
|
|
32
|
+
allowNullish: false,
|
|
33
|
+
allowNever: false,
|
|
34
|
+
allowBoolean: true,
|
|
35
|
+
allowNumber: true,
|
|
36
|
+
allowRegExp: true,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
'unicorn/prefer-node-protocol': 'off',
|
|
40
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ixo/eslint-config",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"base.js",
|
|
10
|
+
"library.js",
|
|
11
|
+
"nest.js",
|
|
12
|
+
"next.js",
|
|
13
|
+
"prettier-base.js",
|
|
14
|
+
"react-internal.js"
|
|
15
|
+
],
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@typescript-eslint/eslint-plugin": "6.17.0",
|
|
18
|
+
"@typescript-eslint/parser": "6.17.0",
|
|
19
|
+
"@vercel/style-guide": "^5.2.0",
|
|
20
|
+
"eslint-config-prettier": "^9.1.0",
|
|
21
|
+
"eslint-config-turbo": "^2.0.0",
|
|
22
|
+
"eslint-plugin-only-warn": "^1.1.0",
|
|
23
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
24
|
+
"typescript": "^5.3.4"
|
|
25
|
+
}
|
|
26
|
+
}
|
package/prettier-base.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const { resolve } = require('node:path');
|
|
2
|
+
|
|
3
|
+
const project = resolve(process.cwd(), 'tsconfig.json');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This is a custom ESLint configuration for use with
|
|
7
|
+
* internal (bundled by their consumer) libraries
|
|
8
|
+
* that utilize React.
|
|
9
|
+
*
|
|
10
|
+
* This config extends the Vercel Engineering Style Guide.
|
|
11
|
+
* For more information, see https://github.com/vercel/style-guide
|
|
12
|
+
*
|
|
13
|
+
* @type {import("eslint").Linter.Config}
|
|
14
|
+
*/
|
|
15
|
+
module.exports = {
|
|
16
|
+
extends: ['./base.js'],
|
|
17
|
+
plugins: ['only-warn'],
|
|
18
|
+
globals: {
|
|
19
|
+
React: true,
|
|
20
|
+
JSX: true,
|
|
21
|
+
},
|
|
22
|
+
env: {
|
|
23
|
+
browser: true,
|
|
24
|
+
},
|
|
25
|
+
settings: {
|
|
26
|
+
'import/resolver': {
|
|
27
|
+
typescript: {
|
|
28
|
+
project,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
ignorePatterns: ['.*.js', 'node_modules/', 'dist/'],
|
|
33
|
+
overrides: [{ files: ['*.js?(x)', '*.ts?(x)'] }],
|
|
34
|
+
};
|