Skip to content

Commit

Permalink
chore: Eslint now works on root folder (#453)
Browse files Browse the repository at this point in the history
* chore: es lint with root folder

* update eslint ignore path
  • Loading branch information
hanwencheng authored and pmespresso committed Nov 9, 2019
1 parent 6613fc2 commit 7418688
Show file tree
Hide file tree
Showing 17 changed files with 103 additions and 97 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
module.exports = {
extends: ["@react-native-community", "plugin:prettier/recommended"],
overrides: [
{
"files": ["e2e/*.spec.js", "e2e/init.js"],
"rules": {
"no-undef": "off"
}
}
],
parserOptions: {
"ecmaVersion": 6,
"sourceType": "module",
Expand Down
12 changes: 6 additions & 6 deletions ReactotronConfig.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Reactotron from "reactotron-react-native";
import Reactotron from 'reactotron-react-native';

if (__DEV__) {
Reactotron.configure({
host: "192.168.1.63"
}) // controls connection & communication settings
.useReactNative() // add all built-in react native plugins
.connect(); // let's connect!
Reactotron.configure({
host: '192.168.1.63'
}) // controls connection & communication settings
.useReactNative() // add all built-in react native plugins
.connect(); // let's connect!
}
42 changes: 21 additions & 21 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
module.exports = {
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [
[
"rewrite-require",
{
"aliases": {
"crypto": "react-native-crypto",
"stream": "readable-stream",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"_stream_readable": "readable-stream/readable",
"_stream_transform": "readable-stream/transform",
"_stream_writable": "readable-stream/writable",
"@polkadot/wasm-crypto": "@plugnet/wasm-crypto-js",
"@plugnet/util": "@polkadot/util",
"vm": "vm-browserify"
}
}
]
]
}
plugins: [
[
'rewrite-require',
{
aliases: {
'@plugnet/util': '@polkadot/util',
'@polkadot/wasm-crypto': '@plugnet/wasm-crypto-js',
_stream_duplex: 'readable-stream/duplex',
_stream_passthrough: 'readable-stream/passthrough',
_stream_readable: 'readable-stream/readable',
_stream_transform: 'readable-stream/transform',
_stream_writable: 'readable-stream/writable',
crypto: 'react-native-crypto',
stream: 'readable-stream',
vm: 'vm-browserify'
}
}
]
],
presets: ['module:metro-react-native-babel-preset']
};
2 changes: 1 addition & 1 deletion docs/privacy-policy.md.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,4 @@ Statutory information
- Registered Number: 09760015
- Registered Office: Ignition Law, Moray House Floor 1, 23-31 Great Titchfield Street, London, United Kingdom, WC1W 7PA.
`
`;
2 changes: 1 addition & 1 deletion docs/terms-and-conditions.md.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions e2e/firstTest.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import testIDs from "./testIDs";
import testIDs from './testIDs';

describe('Load test', () => {
it('should have account list screen', async () => {
await expect(element(by.id(testIDs.TacScreen.tacView))).toBeVisible();
await element(by.id(testIDs.TacScreen.agreePrivacyButton)).tap();
await element(by.id(testIDs.TacScreen.agreeTacButton)).tap();
await element(by.id(testIDs.TacScreen.nextButton)).tap();
await expect(element(by.id(testIDs.AccountListScreen.accountList))).toBeVisible();
});
it('should have account list screen', async () => {
await expect(element(by.id(testIDs.TacScreen.tacView))).toBeVisible();
await element(by.id(testIDs.TacScreen.agreePrivacyButton)).tap();
await element(by.id(testIDs.TacScreen.agreeTacButton)).tap();
await element(by.id(testIDs.TacScreen.nextButton)).tap();
await expect(
element(by.id(testIDs.AccountListScreen.accountList))
).toBeVisible();
});
});
8 changes: 4 additions & 4 deletions e2e/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jasmine.getEnv().addReporter(adapter);
jasmine.getEnv().addReporter(specReporter);

beforeAll(async () => {
await detox.init(config);
await detox.init(config);
});

beforeEach(async () => {
await adapter.beforeEach();
await adapter.beforeEach();
});

afterAll(async () => {
await adapter.afterAll();
await detox.cleanup();
await adapter.afterAll();
await detox.cleanup();
});
12 changes: 6 additions & 6 deletions e2e/testIDs.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const testIDs = {
AccountListScreen: {
accountList: 'accountList'
},
TacScreen: {
tacView: 'tac_view',
agreeTacButton: 'tac_agree',
agreePrivacyButton: 'tac_privacy',
nextButton: 'tac_next'
},
AccountListScreen: {
accountList: 'accountList',
agreeTacButton: 'tac_agree',
nextButton: 'tac_next',
tacView: 'tac_view'
}
};

Expand Down
6 changes: 3 additions & 3 deletions index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
* @flow
*/

import { AppRegistry, YellowBox } from 'react-native'
import { AppRegistry, YellowBox } from 'react-native';
import App from './src/App';
YellowBox.ignoreWarnings([
'Warning: isMounted(...) is deprecated',
'Module RCTImageLoader'
'Warning: isMounted(...) is deprecated',
'Module RCTImageLoader'
]);

AppRegistry.registerComponent('NativeSigner', () => App);
11 changes: 7 additions & 4 deletions index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
* @flow
*/

import { AppRegistry, YellowBox } from 'react-native'
import App from './src/App'
YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated', 'Module RCTImageLoader'])
import { AppRegistry, YellowBox } from 'react-native';
import App from './src/App';
YellowBox.ignoreWarnings([
'Warning: isMounted(...) is deprecated',
'Module RCTImageLoader'
]);

AppRegistry.registerComponent('NativeSigner', () => App)
AppRegistry.registerComponent('NativeSigner', () => App);
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
* @flow
*/

import { AppRegistry, YellowBox } from 'react-native'
import App from './src/App'
YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated', 'Module RCTImageLoader'])
import { AppRegistry, YellowBox } from 'react-native';
import App from './src/App';
YellowBox.ignoreWarnings([
'Warning: isMounted(...) is deprecated',
'Module RCTImageLoader'
]);

AppRegistry.registerComponent('NativeSigner', () => App)
AppRegistry.registerComponent('NativeSigner', () => App);
18 changes: 9 additions & 9 deletions ios/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* @format
*/
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false
}
})
}
};
2 changes: 1 addition & 1 deletion jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
/* global jest */
// import mockCamera from './__mocks__/Camera'

jest.doMock('react-native', () => 'reactNativeMock')
jest.doMock('react-native', () => 'reactNativeMock');
22 changes: 8 additions & 14 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@
const { defaults } = require('jest-config');

module.exports = {
preset: "react-native",
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'],
verbose: true,
roots: [
"<rootDir>/src"
],
setupFiles: [
"<rootDir>/jest-setup.js"
],
testEnvironment: "node",
testPathIgnorePatterns: [
"/node_modules/"
]
}
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'],
preset: 'react-native',
roots: ['<rootDir>/src'],
setupFiles: ['<rootDir>/jest-setup.js'],
testEnvironment: 'node',
testPathIgnorePatterns: ['/node_modules/'],
verbose: true
};
18 changes: 9 additions & 9 deletions metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* @format
*/
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
}
})
}
};
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false
}
})
}
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"clean-rust" : "cd rust/signer && cargo clean && cd ../..",
"commit": "commit-wizard",
"ios": "yarn run build-rust-ios && react-native run-ios",
"lint": "npx eslint ./src/ --ext .js,.jsx",
"lint:fix": "npx eslint ./src/ --ext .js,.jsx --fix",
"lint": "npx eslint . --ext .js,.jsx --ignore-path .gitignore",
"lint:fix": "npx eslint . --ext .js,.jsx --fix --ignore-path .gitignore",
"postinstall": "npx jetify && chmod +x ./scripts/fix-rn-camera-path.sh && ./scripts/fix-rn-camera-path.sh ./node_modules/react-native-camera/ios/RNCamera.xcodeproj/project.pbxproj",
"start": "NODE_OPTIONS=--max_old_space_size=8192 react-native start",
"test": "jest",
Expand Down

0 comments on commit 7418688

Please sign in to comment.