-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreact-native.js
37 lines (35 loc) · 1.49 KB
/
react-native.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var extend = require('extend');
var react = require('./react');
module.exports = extend(true, {}, react, {
'plugins': ['react', 'react-hooks', 'react-native'],
'env': {
'browser': true,
'node': true
},
'globals': {
'__DEV__': true
},
'rules': {
/**
* React Native
*/
// Reactコンポーネントに特定のpropsを禁止
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md
'react/forbid-component-props': 0, // デフォルト設定のclassName, style禁止はreact-nativeには不要
/**
* React Native
*/
// スタイルのカラーリテラル使用禁止
// https://github.com/Intellicode/eslint-plugin-react-native/blob/master/docs/rules/no-color-literals.md
'react-native/no-color-literals': 2,
// インラインスタイル直書きを禁止
// https://github.com/Intellicode/eslint-plugin-react-native/blob/master/docs/rules/no-inline-styles.md
'react-native/no-inline-styles': 2,
// 未利用のStyleを警告
// https://github.com/intellicode/eslint-plugin-react-native/blob/master/docs/rules/no-unused-styles.md
'react-native/no-unused-styles': 2,
// Android/iOS用のコンポーネントのファイル分離を推奨 (x.ios.js, x.android.js)
// https://github.com/Intellicode/eslint-plugin-react-native/blob/master/docs/rules/split-platform-components.md
'react-native/split-platform-components': 0 // 片方のみの場合は不要
}
});