Skip to content

Commit

Permalink
add favorites using localstorage, update lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMelior committed Mar 21, 2024
1 parent f510523 commit 323caae
Show file tree
Hide file tree
Showing 36 changed files with 601 additions and 173 deletions.
55 changes: 15 additions & 40 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ module.exports = {
extends: [
'next/core-web-vitals',
'plugin:react/recommended',
'airbnb',
'plugin:react-hooks/recommended',
'plugin:import/recommended',
'plugin:prettier/recommended',
'plugin:i18next/recommended',
'plugin:storybook/recommended',
],
Expand All @@ -19,51 +21,24 @@ module.exports = {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint', 'react-hooks', 'i18next'],
plugins: ['@typescript-eslint'],
rules: {
'react/jsx-indent': [2, 'tab'],
'react/jsx-indent-props': [2, 'tab'],
indent: [2, 'tab', { SwitchCase: 1 }],
'no-tabs': 0,
'react/jsx-wrap-multilines': 'off',
'operator-linebreak': 'off',
'object-curly-newline': 'off',
'react/jsx-filename-extension': [
2,
{ extensions: ['.js', '.jsx', '.tsx'] },
],
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
'no-unused-vars': 'off',
'react/require-default-props': 'off',
'react/react-in-jsx-scope': 'off',
'react/jsx-props-no-spreading': 'off',
'react/function-component-definition': 'off',
'no-shadow': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'no-underscore-dangle': 'off',
'i18next/no-literal-string': [
'warn',
'prettier/prettier': [
'error',
{
markupOnly: true,
ignoreAttribute: ['data-testid', 'to'],
singleQuote: true,
jsxSingleQuote: true,
useTabs: true,
endOfLine: 'auto',
parser: 'flow',
},
],
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'comma-dangle': ['error', 'always-multiline'],
'jsx-quotes': 'off',
'no-param-reassign': 'off',
'react/jsx-indent': [2, 'tab'],
'react/display-name': 'off',
'react/prop-types': 'off',
'arrow-body-style': 'off',
'max-len': 'off',
'linebreak-style': 'off',
'import/order': 'off',
camelcase: 'off',
'no-plusplus': 'off',
'react/react-in-jsx-scope': 'off',
'i18next/no-literal-string': 'warn',
},
globals: {
IS_DEV: true,
Expand Down
3 changes: 2 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"rules": {
"selector-class-pattern": "^([a-z][a-zA-Z0-9]*)$",
"keyframes-name-pattern": "^([a-z][a-zA-Z0-9]*)$",
"color-function-notation": "legacy",
"color-function-notation": null,
"rule-empty-line-before": null,
"scss/at-rule-no-unknown": [
true,
{
Expand Down
4 changes: 2 additions & 2 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { ReactNode, Suspense } from 'react';
const inter = Inter({ subsets: ['latin'] });

type LocaleLayoutProps = {
children: ReactNode;
params: { locale: string };
children: ReactNode,
params: { locale: string },
};

export function generateStaticParams() {
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { unstable_setRequestLocale } from 'next-intl/server';
import { FC } from 'react';

type IndexPageProps = {
params: { locale: string };
params: { locale: string },
};

const IndexPage: FC<IndexPageProps> = ({ params: { locale } }) => {
Expand Down
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactNode } from 'react';

type Props = {
children: ReactNode;
children: ReactNode,
};

// Since we have a `not-found.tsx` page on the root, a layout file
Expand Down
6 changes: 1 addition & 5 deletions config/jest/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

import path from 'path';

// eslint-disable-next-line import/no-anonymous-default-export
export default {
clearMocks: true,
testEnvironment: 'jsdom',
Expand Down
1 change: 0 additions & 1 deletion config/jest/jestEmptyComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line func-names
const jestEmptyComponent = function () {
return <div />;
};
Expand Down
1 change: 0 additions & 1 deletion json-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ server.post('/login', (req, res) => {
});

// проверяем, авторизован ли пользователь
// eslint-disable-next-line
// server.use((req, res, next) => {
// if (!req.headers.authorization) {
// return res.status(403).json({ message: 'AUTH ERROR' });
Expand Down
Loading

0 comments on commit 323caae

Please sign in to comment.