Skip to content

Commit

Permalink
Merge pull request #566 from jemise111/lint-fixes
Browse files Browse the repository at this point in the history
Fix eslint, prettier and run linter
  • Loading branch information
jemise111 authored Jun 18, 2021
2 parents faebbe4 + 519f683 commit fe57b0a
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 54 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
SwipeListExample/node_modules/
39 changes: 39 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
env: {
es6: true,
node: true,
jest: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['prettier', 'react'],
rules: {
'prettier/prettier': 'error',
'prefer-const': 'warn',
'no-var': 'warn',
'react/prop-types': 'off',
curly: 'warn',
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',
},
settings: {
react: {
version: 'latest',
},
},
};
36 changes: 0 additions & 36 deletions .eslintrc.json

This file was deleted.

4 changes: 0 additions & 4 deletions SwipeListExample/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion SwipeListExample/__tests__/App-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ import App from '../App';
import renderer from 'react-test-renderer';

it('renders correctly', () => {
renderer.create(<App />);
renderer.create(<App />);
});
2 changes: 1 addition & 1 deletion SwipeListExample/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:metro-react-native-babel-preset'],
};
2 changes: 1 addition & 1 deletion SwipeListExample/examples/close_row_manually.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function Basic() {
</TouchableHighlight>
);

const renderHiddenItem = (data, rowMap) => (
const renderHiddenItem = () => (
<View style={styles.rowBack}>
<Text>Left</Text>
<View style={[styles.backRightBtn, styles.backRightBtnLeft]}>
Expand Down
4 changes: 2 additions & 2 deletions SwipeListExample/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @format
*/

import {AppRegistry} from 'react-native';
import { AppRegistry } from 'react-native';
import App from './example';
import {name as appName} from './app.json';
import { name as appName } from './app.json';

AppRegistry.registerComponent(appName, () => App);
16 changes: 8 additions & 8 deletions SwipeListExample/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*/

module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "node_modules/react-native/packager/packager.sh",
"dev": "node bin/dev.js && cd SwipeListExample && npm run start",
"prettier": "prettier --write --loglevel=warn \"**/*.js\"",
"lint": "eslint **/*.js",
"lint": "eslint . --ext .js",
"fix": "yarn run prettier && yarn run lint"
},
"repository": {
Expand Down

0 comments on commit fe57b0a

Please sign in to comment.