Skip to content

Commit 772aaf1

Browse files
authored
Merge pull request #15 from CodinGame/fix-eslint-ts-config
Fix eslint ts config
2 parents c4f3881 + 461a4d4 commit 772aaf1

File tree

5 files changed

+54
-110
lines changed

5 files changed

+54
-110
lines changed

.eslintrc.js

Lines changed: 4 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -4,116 +4,19 @@ module.exports = {
44
es6: true
55
},
66
extends: [
7-
'standard', 'standard-jsx'
7+
'@codingame', 'standard-jsx'
88
],
9-
globals: {
10-
Atomics: 'readonly',
11-
SharedArrayBuffer: 'readonly'
12-
},
13-
parser: '@typescript-eslint/parser',
149
parserOptions: {
1510
ecmaFeatures: {
1611
jsx: true
17-
},
18-
ecmaVersion: 2018,
19-
sourceType: 'module',
20-
project: './tsconfig.json'
12+
}
2113
},
2214
plugins: [
2315
'react',
24-
'@typescript-eslint',
25-
'react-hooks',
26-
'unused-imports'
16+
'react-hooks'
2717
],
2818
rules: {
29-
'@typescript-eslint/member-delimiter-style': [
30-
'error',
31-
{
32-
multiline: {
33-
delimiter: 'none'
34-
},
35-
singleline: {
36-
delimiter: 'comma'
37-
}
38-
}
39-
],
40-
'@typescript-eslint/no-misused-promises': [
41-
'error',
42-
{ checksVoidReturn: false }
43-
],
44-
'no-unused-vars': 'off',
45-
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true }],
46-
'no-use-before-define': 'off',
47-
'@typescript-eslint/no-use-before-define': [
48-
'error',
49-
{
50-
functions: false,
51-
classes: false,
52-
variables: false
53-
}
54-
],
55-
'@typescript-eslint/no-useless-constructor': 'error',
56-
'@typescript-eslint/type-annotation-spacing': 'error',
57-
'import/named': 'off',
58-
'import/namespace': 'off',
59-
'import/no-unresolved': 'off',
60-
'import/order': [
61-
'warn',
62-
{
63-
groups: ['unknown', 'external', 'internal', 'builtin', 'index', 'sibling', 'parent'],
64-
'newlines-between': 'never'
65-
}
66-
],
67-
'no-console': ['warn', { allow: ['warn', 'error', 'debug', 'info'] }],
68-
'no-useless-constructor': 'off',
69-
'unused-imports/no-unused-imports': 'warn',
70-
'no-redeclare': 'off',
71-
'@typescript-eslint/no-redeclare': ['error'],
72-
'@typescript-eslint/no-unnecessary-condition': 'warn',
73-
'@typescript-eslint/explicit-module-boundary-types': [
74-
'warn',
75-
{
76-
allowArgumentsExplicitlyTypedAsAny: true
77-
}
78-
],
79-
semi: 'off',
80-
'@typescript-eslint/semi': [
81-
'error', 'never'
82-
],
83-
'eslint/no-extra-semi': 'off',
84-
'@typescript-eslint/no-extra-semi': [
85-
'warn'
86-
],
87-
'@typescript-eslint/strict-boolean-expressions': [
88-
'warn',
89-
{
90-
allowString: false,
91-
allowNumber: false,
92-
allowNullableObject: false
93-
}
94-
],
95-
'@typescript-eslint/no-explicit-any': [
96-
'error',
97-
{
98-
ignoreRestArgs: true
99-
}
100-
],
101-
'@typescript-eslint/no-unnecessary-type-assertion': ['error'],
102-
'@typescript-eslint/no-floating-promises': [
103-
'error'
104-
],
105-
'no-void': [
106-
'error',
107-
{
108-
allowAsStatement: true
109-
}
110-
],
111-
'react-hooks/exhaustive-deps': [
112-
'error',
113-
{
114-
additionalHooks: '(useDebouncedCallback)'
115-
}
116-
],
19+
'react-hooks/exhaustive-deps': 'error',
11720
'react-hooks/rules-of-hooks': 'error'
11821
}
11922
}

.github/workflows/check_build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Check build
2-
on: [push]
2+
on:
3+
push:
4+
branches-ignore:
5+
- main
36

47
jobs:
58
check:

package-lock.json

Lines changed: 40 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
"version": "0.0.0-semantic-release",
44
"description": "Monaco Editor React component",
55
"scripts": {
6-
"build": "tsc",
7-
"lint": "npx eslint src/**"
6+
"build": "npm run lint && npm run compile",
7+
"compile": "tsc",
8+
"lint": "eslint --ext .ts src/"
89
},
910
"repository": {
1011
"type": "git",
@@ -23,6 +24,8 @@
2324
"lodash.debounce": "^4.0.8"
2425
},
2526
"devDependencies": {
27+
"@codingame/eslint-config": "^1.1.2",
28+
"@codingame/tsconfig": "^1.0.5",
2629
"@types/deep-equal": "^1.0.1",
2730
"@types/lodash.debounce": "^4.0.7",
2831
"@types/react": "17.0.40",
@@ -34,7 +37,6 @@
3437
"eslint-config-standard-jsx": "11.0.0",
3538
"eslint-plugin-import": "2.26.0",
3639
"eslint-plugin-node": "11.1.0",
37-
"eslint-plugin-promise": "6.0.0",
3840
"eslint-plugin-react": "7.30.0",
3941
"eslint-plugin-react-hooks": "4.6.0",
4042
"eslint-plugin-unused-imports": "2.0.0",

tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
2+
"extends": "@codingame/tsconfig",
23
"compilerOptions": {
34
"outDir": "dist/",
45
"declaration": true,
56
"skipLibCheck": true,
67
"allowSyntheticDefaultImports": true,
7-
"strict": true,
88
"baseUrl": "./app",
9-
"esModuleInterop": true,
10-
"forceConsistentCasingInFileNames": true,
119
"isolatedModules": true,
1210
"jsx": "react",
1311
"lib": [
@@ -16,7 +14,6 @@
1614
"esnext"
1715
],
1816
"module": "esnext",
19-
"moduleResolution": "node",
2017
"paths": {
2118
"app/*": [
2219
"*"

0 commit comments

Comments
 (0)