Skip to content

Commit 8fcc78d

Browse files
author
ugogo
committed
update prettier and eslint config
1 parent d9ab559 commit 8fcc78d

File tree

11 files changed

+43
-39
lines changed

11 files changed

+43
-39
lines changed

.prettierrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"singleQuote": true,
33
"jsxSingleQuote": true,
4-
"semi": false,
4+
"semi": true,
55
"tabWidth": 2,
66
"bracketSpacing": true,
77
"jsxBracketSameLine": false,
88
"arrowParens": "always",
9-
"trailingComma": "none"
9+
"trailingComma": "es5"
1010
}

example/src/App.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from 'react'
2-
import ReactDOM from 'react-dom'
3-
import App from './App'
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import App from './App';
44

55
it('renders without crashing', () => {
6-
const div = document.createElement('div')
7-
ReactDOM.render(<App />, div)
8-
ReactDOM.unmountComponentAtNode(div)
9-
})
6+
const div = document.createElement('div');
7+
ReactDOM.render(<App />, div);
8+
ReactDOM.unmountComponentAtNode(div);
9+
});

example/src/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React from 'react'
1+
import React from 'react';
22

3-
import { ExampleComponent } from 'react-verification-code'
4-
import 'react-verification-code/dist/index.css'
3+
import { ExampleComponent } from 'react-verification-code';
4+
import 'react-verification-code/dist/index.css';
55

66
const App = () => {
7-
return <ExampleComponent text="Create React Library Example 😄" />
8-
}
7+
return <ExampleComponent text='Create React Library Example 😄' />;
8+
};
99

10-
export default App
10+
export default App;

example/src/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import './index.css'
1+
import './index.css';
22

3-
import React from 'react'
4-
import ReactDOM from 'react-dom'
5-
import App from './App'
3+
import React from 'react';
4+
import ReactDOM from 'react-dom';
5+
import App from './App';
66

7-
ReactDOM.render(<App />, document.getElementById('root'))
7+
ReactDOM.render(<App />, document.getElementById('root'));

example/tsconfig.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@
1515
"suppressImplicitAnyIndexErrors": true,
1616
"noUnusedLocals": true,
1717
"noUnusedParameters": true,
18-
"allowSyntheticDefaultImports": true
18+
"allowSyntheticDefaultImports": true,
19+
"target": "es5",
20+
"allowJs": true,
21+
"skipLibCheck": true,
22+
"strict": true,
23+
"forceConsistentCasingInFileNames": true,
24+
"resolveJsonModule": true,
25+
"isolatedModules": true,
26+
"noEmit": true
1927
},
2028
"include": ["src"],
2129
"exclude": ["node_modules", "build"]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"prepare": "run-s build",
1818
"test": "run-s test:unit test:lint test:build",
1919
"test:build": "run-s build",
20-
"test:lint": "eslint .",
20+
"test:lint": "eslint \"./src/**/*.+(ts|tsx)\"",
2121
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
2222
"test:watch": "react-scripts test --env=jsdom",
2323
"predeploy": "cd example && yarn install && yarn run build",

src/.eslintrc

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

src/index.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { ExampleComponent } from '.'
1+
import { ExampleComponent } from '.';
22

33
describe('ExampleComponent', () => {
44
it('is truthy', () => {
5-
expect(ExampleComponent).toBeTruthy()
6-
})
7-
})
5+
expect(ExampleComponent).toBeTruthy();
6+
});
7+
});

src/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import * as React from 'react'
2-
import styles from './styles.module.css'
1+
import * as React from 'react';
2+
import styles from './styles.module.css';
33

44
interface Props {
5-
text: string
5+
text: string;
66
}
77

88
export const ExampleComponent = ({ text }: Props) => {
9-
return <div className={styles.test}>Example Component: {text}</div>
10-
}
9+
return <div className={styles.test}>Example Component: {text}</div>;
10+
};

src/typings.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ declare module '*.css' {
77
export default content;
88
}
99

10-
interface SvgrComponent extends React.StatelessComponent<React.SVGAttributes<SVGElement>> {}
10+
interface SvgrComponent
11+
extends React.StatelessComponent<React.SVGAttributes<SVGElement>> {}
1112

1213
declare module '*.svg' {
1314
const svgUrl: string;
1415
const svgComponent: SvgrComponent;
1516
export default svgUrl;
16-
export { svgComponent as ReactComponent }
17+
export { svgComponent as ReactComponent };
1718
}

0 commit comments

Comments
 (0)