Skip to content

Commit

Permalink
lint: remove redundant import extensions
Browse files Browse the repository at this point in the history
Refs #422
  • Loading branch information
thewilkybarkid committed Nov 9, 2021
1 parent e03ce5f commit 7594a02
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 69 deletions.
15 changes: 11 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
"plugin:promise/recommended",
"plugin:react/recommended",
"prettier"
]
],
"rules": {
"import/extensions": "error"
}
},
{
"files": [
Expand All @@ -60,9 +63,13 @@
"prettier"
],
"rules": {
"import/namespace": ["error", {
"allowComputed": true
}],
"import/extensions": "error",
"import/namespace": [
"error",
{
"allowComputed": true
}
],
"jest/no-disabled-tests": "off",
"no-useless-assign/no-useless-assign": "warn",
"node/no-missing-import": "off",
Expand Down
2 changes: 1 addition & 1 deletion src/backend/controllers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import router from 'koa-joi-router';
import anonymus from 'anonymus';
import merge from 'lodash.merge';
import { getLogger } from '../log.ts';
import { getOrcidPerson, getOrcidWorks, processWorks } from '../utils/orcid.js';
import { getOrcidPerson, getOrcidWorks, processWorks } from '../utils/orcid';

const log = getLogger('backend:controllers:auth');

Expand Down
32 changes: 16 additions & 16 deletions src/backend/controllers/docs.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { koaSwagger } from 'koa2-swagger-ui';
import { SwaggerAPI } from 'koa-joi-router-docs';
import preprintRoutes from '../controllers/preprint.js';
import preprintRoutes from '../controllers/preprint';
import { getLogger } from '../log.ts';
import router from 'koa-joi-router';
import userRoutes from './user.js';
import fullReviewRoutes from './fullReview.js';
import commentRoutes from './comment.js';
import badgeRoutes from './badge.js';
import expertiseRoutes from './expertise.js';
import communityRoutes from './community.js';
import eventRoutes from './event.js';
import groupRoutes from './group.js';
import personaRoutes from './persona.js';
import rapidReviewRoutes from './rapidReview.js';
import reportRoutes from '../controllers/report.js';
import requestRoutes from './request.js';
import tagRoutes from './tag.js';
import templateRoutes from './template.js';
import notificationRoutes from '../controllers/notification.js';
import userRoutes from './user';
import fullReviewRoutes from './fullReview';
import commentRoutes from './comment';
import badgeRoutes from './badge';
import expertiseRoutes from './expertise';
import communityRoutes from './community';
import eventRoutes from './event';
import groupRoutes from './group';
import personaRoutes from './persona';
import rapidReviewRoutes from './rapidReview';
import reportRoutes from '../controllers/report';
import requestRoutes from './request';
import tagRoutes from './tag';
import templateRoutes from './template';
import notificationRoutes from '../controllers/notification';

const log = getLogger('apiDocs:::');

Expand Down
2 changes: 1 addition & 1 deletion src/backend/controllers/group.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import router from 'koa-joi-router';
import { getLogger } from '../log.ts';
import { getErrorMessages } from '../utils/errors.js';
import { getErrorMessages } from '../utils/errors';

const Joi = router.Joi;
const log = getLogger('backend:controllers:group');
Expand Down
34 changes: 17 additions & 17 deletions src/backend/scripts/genSpec.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { SwaggerAPI } from 'koa-joi-router-docs';
import preprintRoutes from '../controllers/preprint.js';
import authWrapper from '../middleware/auth.js';
import userRoutes from '../controllers/user.js';
import fullReviewRoutes from '../controllers/fullReview.js';
import commentRoutes from '../controllers/comment.js';
import badgeRoutes from '../controllers/badge.js';
import expertiseRoutes from '../controllers/expertise.js';
import communityRoutes from '../controllers/community.js';
import eventRoutes from '../controllers/event.js';
import groupRoutes from '../controllers/group.js';
import personaRoutes from '../controllers/persona.js';
import rapidReviewRoutes from '../controllers/rapidReview.js';
import reportRoutes from '../controllers/report.js';
import requestRoutes from '../controllers/request.js';
import tagRoutes from '../controllers/tag.js';
import templateRoutes from '../controllers/template.js';
import notificationRoutes from '../controllers/notification.js';
import preprintRoutes from '../controllers/preprint';
import authWrapper from '../middleware/auth';
import userRoutes from '../controllers/user';
import fullReviewRoutes from '../controllers/fullReview';
import commentRoutes from '../controllers/comment';
import badgeRoutes from '../controllers/badge';
import expertiseRoutes from '../controllers/expertise';
import communityRoutes from '../controllers/community';
import eventRoutes from '../controllers/event';
import groupRoutes from '../controllers/group';
import personaRoutes from '../controllers/persona';
import rapidReviewRoutes from '../controllers/rapidReview';
import reportRoutes from '../controllers/report';
import requestRoutes from '../controllers/request';
import tagRoutes from '../controllers/tag';
import templateRoutes from '../controllers/template';
import notificationRoutes from '../controllers/notification';

function docs() {
const generator = new SwaggerAPI();
Expand Down
40 changes: 20 additions & 20 deletions src/backend/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import serialize from 'serialize-javascript';
import { createError } from './utils/http-errors';

// Our middlewares
import authWrapper from './middleware/auth.js'; // authorization/user roles
import authWrapper from './middleware/auth'; // authorization/user roles
import currentCommunity from './middleware/community';
import currentPersona from './middleware/persona';
import currentUser from './middleware/user';
Expand Down Expand Up @@ -58,25 +58,25 @@ import {
} from './models';

// Our controllers
import AuthController from './controllers/auth.js'; // authentication/logins
import BadgeController from './controllers/badge.js';
import CommentController from './controllers/comment.js';
import CommunityController from './controllers/community.js';
import ExpertiseController from './controllers/expertise.js';
import FullReviewController from './controllers/fullReview.js';
import DraftController from './controllers/fullReviewDraft.js';
import GroupController from './controllers/group.js';
import UserController from './controllers/user.js';
import PersonaController from './controllers/persona.js';
import PreprintController from './controllers/preprint.js';
import RapidController from './controllers/rapidReview.js';
import ReportController from './controllers/report.js';
import RequestController from './controllers/request.js';
import TagController from './controllers/tag.js';
import TemplateController from './controllers/template.js';
import DocsController from './controllers/docs.js';
import EventController from './controllers/event.js';
import NotificationController from './controllers/notification.js';
import AuthController from './controllers/auth'; // authentication/logins
import BadgeController from './controllers/badge';
import CommentController from './controllers/comment';
import CommunityController from './controllers/community';
import ExpertiseController from './controllers/expertise';
import FullReviewController from './controllers/fullReview';
import DraftController from './controllers/fullReviewDraft';
import GroupController from './controllers/group';
import UserController from './controllers/user';
import PersonaController from './controllers/persona';
import PreprintController from './controllers/preprint';
import RapidController from './controllers/rapidReview';
import ReportController from './controllers/report';
import RequestController from './controllers/request';
import TagController from './controllers/tag';
import TemplateController from './controllers/template';
import DocsController from './controllers/docs';
import EventController from './controllers/event';
import NotificationController from './controllers/notification';

/* eslint-disable @typescript-eslint/ban-ts-comment */

Expand Down
2 changes: 1 addition & 1 deletion src/common/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './ids.js';
export * from './ids';
2 changes: 1 addition & 1 deletion src/frontend/components/Communities.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useGetCommunities, useGetTags } from '../hooks/api-hooks.tsx';
import { processParams, searchParamsToObject } from '../utils/search';

// components
import CommunityCard from './CommunityCard.js';
import CommunityCard from './CommunityCard';
import HeaderBar from './header-bar';
import Loading from './loading';
import SearchBar from './search-bar';
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/Community.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Helmet } from 'react-helmet-async';
import MuiSearchBar from 'material-ui-search-bar';
import { useIntl } from 'react-intl';

import { createPreprintId } from '../../common/utils/ids.js';
import { createPreprintId } from '../../common/utils/ids';

// contexts
import UserProvider from '../contexts/user-context';
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/activity-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';

// utils
import { getFormattedDatePosted } from '../utils/preprints';
import { createPreprintId } from '../../common/utils/ids.js';
import { createPreprintId } from '../../common/utils/ids';

// hooks
import { useGetPreprint } from '../hooks/api-hooks.tsx';
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { subDays } from 'date-fns';
import { useHistory, useLocation } from 'react-router-dom';

// utils
import { createPreprintId } from '../../common/utils/ids.js';
import { createPreprintId } from '../../common/utils/ids';

import { ORG } from '../constants';

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/preprint-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { formatDistanceStrict } from 'date-fns';
// utils
import { getTags } from '../utils/stats';
import { getFormattedDatePosted } from '../utils/preprints';
import { createPreprintId, decodePreprintId } from '../../common/utils/ids.js';
import { createPreprintId, decodePreprintId } from '../../common/utils/ids';

// hooks
import { useAnimatedScore } from '../hooks/score-hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/preprint-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useHistory } from 'react-router-dom';

// utils
import { getFormattedDatePosted } from '../utils/preprints';
import { createPreprintId } from '../../common/utils/ids.js';
import { createPreprintId } from '../../common/utils/ids';

// Material UI components
import { makeStyles } from '@material-ui/core/styles';
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/recent-activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';

//utils
import { formatDistanceStrict } from 'date-fns';
import { createPreprintId } from '../../common/utils/ids.js';
import { createPreprintId } from '../../common/utils/ids';

//material ui
import Link from '@material-ui/core/Link';
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/reviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
} from '../hooks/ui-hooks';

// utils
import { createPreprintId } from '../../common/utils/ids.js';
import { createPreprintId } from '../../common/utils/ids';
import { processParams, searchParamsToObject } from '../utils/search';

// components
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/shell-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useLocation } from 'react-router-dom';
import { usePostRequests } from '../hooks/api-hooks.tsx';

// utils
import { createPreprintId } from '../../common/utils/ids.js';
import { createPreprintId } from '../../common/utils/ids';

// Material UI imports
import { makeStyles } from '@material-ui/core/styles';
Expand Down

0 comments on commit 7594a02

Please sign in to comment.