Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Commit 3693c36

Browse files
authored
Merge pull request #139 from tpucci/tslint-to-eslint
Migrate from tslint to typescript-eslint
2 parents cbbc2bb + 5bb7b76 commit 3693c36

34 files changed

Lines changed: 382 additions & 606 deletions

.eslintrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
6+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
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,
11+
sourceType: 'module',
12+
ecmaFeatures: {
13+
jsx: true,
14+
},
15+
},
16+
rules: {
17+
'@typescript-eslint/indent': 'off',
18+
'@typescript-eslint/explicit-function-return-type': 'off',
19+
'@typescript-eslint/explicit-member-accessibility': 'off',
20+
},
21+
settings: {
22+
react: {
23+
version: 'detect',
24+
},
25+
},
26+
env: {
27+
browser: true,
28+
node: true,
29+
},
30+
overrides: [
31+
{
32+
files: ['**/*.test.ts', '**/*.test.tsx'],
33+
env: {
34+
jest: true,
35+
},
36+
rules: {
37+
'@typescript-eslint/explicit-function-return-type': 'off',
38+
},
39+
},
40+
],
41+
};

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
package.json

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"trailingComma": "es5",
3+
"singleQuote": true,
4+
"printWidth": 100
5+
}

.vscode/settings.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"prettier.eslintIntegration": true,
3-
"javascript.validate.enable": false,
42
"editor.formatOnSave": true,
3+
"eslint.enable": true,
4+
"eslint.packageManager": "yarn",
5+
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
6+
"javascript.validate.enable": false,
57
"jest.showCoverageOnLoad": true,
6-
"typescript.validate.enable": true,
78
"npm.packageManager": "yarn",
8-
"eslint.packageManager": "yarn",
9-
"prettier.tslintIntegration": true
9+
"prettier.requireConfig": true,
10+
"typescript.validate.enable": true
1011
}

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
[![Build Status](https://travis-ci.com/tpucci/react-gondola.svg?branch=master)](https://travis-ci.com/tpucci/react-gondola)
2-
[![Coverage Status](https://coveralls.io/repos/github/tpucci/react-gondola/badge.svg?branch=master)](https://coveralls.io/github/tpucci/react-gondola?branch=master)
3-
![npm](https://img.shields.io/npm/dw/react-gondola.svg)
4-
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
5-
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
1+
<h1 align="center">React Gondola</h1>
62

7-
# React Gondola
3+
<p align="center">React Native declarative and reactive navigation.</p>
84

9-
React Native declarative and reactive navigation.
5+
<p align="center">
6+
<a href="https://travis-ci.com/tpucci/react-gondola"><img src="https://travis-ci.com/tpucci/react-gondola.svg?branch=master" alt="Build Status"/></a>
7+
<a href="https://coveralls.io/github/tpucci/react-gondola?branch=master"><img src="https://coveralls.io/repos/github/tpucci/react-gondola/badge.svg?branch=master" alt="Coverage Status"/></a>
8+
<a href="https://www.npmjs.com/package/react-gondola"><img src="https://img.shields.io/npm/dw/react-gondola.svg" alt="NPM Downloads"/></a>
9+
<a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen friendly"/></a>
10+
<a href="https://github.com/semantic-release/semantic-release"><img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg" alt="semantic-release"/></a>
11+
</p>
12+
13+
<br>
1014

1115
## Philosophy
1216

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"postinstall": "patch-package",
77
"start": "node ../node_modules/react-native/local-cli/cli.js start",
8-
"test:lint": "cd .. && yarn tslint example/src/**/*.ts{,x} && cd example",
8+
"test:lint": "cd .. && yarn eslint example/src/**/*.ts{,x} && cd example",
99
"test:unit": "cd .. && yarn jest --config=example/jest.config.js && cd example",
1010
"test:unit:u": "cd .. && yarn jest --config=example/jest.config.js -u && cd example",
1111
"test:unit:ci": "cd .. && yarn jest --config=example/jest.config.js --runInBand && cd example",

example/src/App.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import React, { Component } from 'react';
22
import { SignIn } from './canals/SignIn';
33
import { FullScreenPortal } from 'react-gondola';
44

5-
interface IProps {}
6-
export default class App extends Component<IProps> {
5+
export default class App extends Component<{}> {
76
render() {
87
return (
98
<FullScreenPortal>

example/src/canals/SignIn/Confirm.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React, { Component } from 'react';
22
import { SignIn } from './SignIn';
33

4-
interface IProps {}
5-
export class Confirm extends Component<IProps> {
4+
export class Confirm extends Component<{}> {
65
render() {
76
return <SignIn />;
87
}

example/src/canals/SignIn/FirstName.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
import React, { Component } from 'react';
22
import { StyleSheet, Text, View, Button, TextInput } from 'react-native';
33

4-
interface IProps {
4+
interface Props {
55
onNext: () => any;
66
}
7-
export class FirstName extends Component<IProps> {
7+
8+
const styles = StyleSheet.create({
9+
container: {
10+
alignItems: 'center',
11+
backgroundColor: '#FFAAAA',
12+
flex: 1,
13+
justifyContent: 'space-around',
14+
},
15+
});
16+
17+
export class FirstName extends Component<Props> {
818
render() {
919
return (
1020
<View style={styles.container}>
@@ -15,12 +25,3 @@ export class FirstName extends Component<IProps> {
1525
);
1626
}
1727
}
18-
19-
const styles = StyleSheet.create({
20-
container: {
21-
alignItems: 'center',
22-
backgroundColor: '#FFAAAA',
23-
flex: 1,
24-
justifyContent: 'space-around'
25-
}
26-
});

0 commit comments

Comments
 (0)