Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit81a1041

Browse files
committed
setup react liniting & tsconfig
1 parent54e06de commit81a1041

File tree

5 files changed

+126
-5
lines changed

5 files changed

+126
-5
lines changed

‎package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
]
2525
},
2626
"scripts": {
27-
"vscode:prepublish":"npm runcompile",
27+
"vscode:prepublish":"npm runbuild",
2828
"machine":"node ./out/state/index.js",
2929
"build":"npm run compile && npm run build:web",
30-
"build:web":"tsc -p web-app/ && cp -R web-app/build/ out/",
30+
"build:web":"tsc -p web-app/tsconfig.json && cp -R web-app/build/ out/",
3131
"compile":"tsc -p ./",
3232
"watch":"tsc -watch -p ./",
3333
"postinstall":"node ./node_modules/vscode/bin/install",

‎web-app/.eslintrc.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
module.exports={
2+
parser:'typescript-eslint-parser',
3+
// extends: [
4+
// 'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
5+
// 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
6+
// 'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
7+
// 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
8+
// ],
9+
parserOptions:{
10+
ecmaVersion:2018,// Allows for the parsing of modern ECMAScript features
11+
sourceType:'module',// Allows for the use of imports
12+
ecmaFeatures:{
13+
jsx:true,// Allows for the parsing of JSX
14+
useJSXTextNode:true,
15+
},
16+
},
17+
rules:{
18+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
19+
// e.g.
20+
'arrow-parens':0,
21+
'comma-dangle':0,
22+
'global-require':0,
23+
'import/no-extraneous-dependencies':0,
24+
'import/no-named-as-default':0,
25+
'import/prefer-default-export':0,
26+
'jsx-a11y/href-no-hash':0,
27+
quotes:['error','single'],
28+
'no-tabs':0,
29+
'react/jsx-curly-spacing':0,
30+
'react/jsx-indent-props':'off',
31+
'react/prop-types':0,
32+
'react/sort-comp':0,
33+
'react/prefer-stateless-function':0,
34+
semi:['error','never'],
35+
'object-curly-newline':0,
36+
'react/jsx-indent':'off',
37+
'class-methods-use-this':0,
38+
indent:'off',
39+
'implicit-arrow-linebreak':'off',
40+
'function-paren-newline':'off',
41+
'lines-between-class-members':'off',
42+
'no-unreachable':'off',
43+
'import/no-unresolved':'off',
44+
'no-unused-vars':'off',
45+
'no-confusing-arrow':'off',
46+
'no-restricted-syntax':'off',
47+
'react/jsx-one-expression-per-line':'off',
48+
'guard-for-in':'off',
49+
'no-nested-ternary':'off',
50+
'no-underscore-dangle':'off',
51+
'react/destructuring-assignment':'off',
52+
'no-return-assign':'off',
53+
'no-case-declarations':'off',
54+
'react/no-array-index-key':'off',
55+
},
56+
settings:{
57+
react:{
58+
version:'detect',// Tells eslint-plugin-react to automatically detect the version of React to use
59+
},
60+
},
61+
}

‎web-app/package-lock.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎web-app/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"scripts": {
1616
"start":"react-scripts start",
17-
"build":"react-scripts build",
17+
"build":"react-scripts build && cp -R ./build/ ../out/",
1818
"test":"react-scripts test",
1919
"eject":"react-scripts eject"
2020
},
@@ -32,5 +32,8 @@
3232
"last 1 firefox version",
3333
"last 1 safari version"
3434
]
35+
},
36+
"devDependencies": {
37+
"typescript-eslint-parser":"^22.0.0"
3538
}
3639
}

‎web-app/tsconfig.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
11
{
2-
"extends":"./tsconfig.prod.json"
3-
}
2+
"compilerOptions": {
3+
"target":"es5",
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
9+
"allowJs":true,
10+
"skipLibCheck":true,
11+
"esModuleInterop":true,
12+
"allowSyntheticDefaultImports":true,
13+
"strict":true,
14+
"forceConsistentCasingInFileNames":true,
15+
"module":"esnext",
16+
"moduleResolution":"node",
17+
"resolveJsonModule":true,
18+
"isolatedModules":true,
19+
"noEmit":true,
20+
"jsx":"preserve"
21+
},
22+
"include": [
23+
"src"
24+
]
25+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp