Skip to content

Commit

Permalink
explorer-client: improve linting rules (#506)
Browse files Browse the repository at this point in the history
* explorer-client: improve linting rules

* no binding for jsx attrs
* no duplicate imports
* group scss/css imports together after type imports

* explorer-client: apply linting rules

* also rename index.scss to index.css (leftover from scss removing)
  • Loading branch information
pchrysochoidis authored Mar 7, 2022
1 parent cc85761 commit d442f64
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions explorer/client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
extends: ['react-app', 'react-app/jest', 'prettier'],
rules: {
'react/jsx-no-bind': ['error'],
'import/order': [
'warn',
{
Expand All @@ -9,10 +10,19 @@ module.exports = {
['internal', 'parent', 'sibling', 'index'],
'type',
],
pathGroups: [
{
pattern: '{.,..}/**/*.css',
group: 'type',
position: 'after',
},
],
'newlines-between': 'always',
alphabetize: { order: 'asc' },
warnOnUnassignedImports: true,
},
],
'import/no-duplicates': ['error'],
'@typescript-eslint/consistent-type-imports': [
'error',
{
Expand Down
1 change: 1 addition & 0 deletions explorer/client/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Footer from '../components/footer/Footer';
import Header from '../components/header/Header';
import Search from '../components/search/Search';
import AppRoutes from '../pages/config/AppRoutes';

import styles from './App.module.css';

function App() {
Expand Down
1 change: 1 addition & 0 deletions explorer/client/src/components/footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Link } from 'react-router-dom';

import ExternalLink from '../external-link/ExternalLink';

import styles from './Footer.module.css';

function Footer() {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion explorer/client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BrowserRouter as Router } from 'react-router-dom';
import App from './app/App';
import reportWebVitals from './utils/reportWebVitals';

import './index.scss';
import './index.css';

ReactDOM.render(
<React.StrictMode>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useParams } from 'react-router-dom';

import mockTransactionData from '../../utils/transaction_mock.json';

import styles from './TransactionResult.module.css';

type DataType = {
Expand Down

0 comments on commit d442f64

Please sign in to comment.