Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature linter formatter #72

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.vs
.vscode
source_documents
my_env
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ Follow [Anil Chandra Naidu Matcha](https://twitter.com/matchaman11) & [Ankur Sin

2. Go to server folder and run the below commands

```shell
python -m venv my_env
```

```shell
// Linux
source ./my_env/Scripts/activate

// Windows
my_env\Scripts\activate
```

```shell
pip install -r requirements.txt
```
Expand Down
59 changes: 59 additions & 0 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true
},
settings: {
react: {
version: "detect"
},
next: {
rootDir: "."
}
},
extends: [
"standard",
"eslint:recommended",
"next/core-web-vitals",
"prettier"
],
parserOptions: {
ecmaVersion: 2019,
sourceType: "module",
ecmaFeatures: {
jsx: true
},
babelOptions: {
presets: [require.resolve('next/babel')],
}
},
rules: {
strict: "off",
camelcase: "off",
"prefer-const": ["error", { destructuring: "all" }],
"no-inline-comments": "off",
curly: ["error", "all"],
"max-nested-callbacks": ["error", { max: 4 }],
"max-statements-per-line": ["error", { max: 2 }],
"no-unused-vars": [
"error",
{
argsIgnorePattern: "(_.*)"
}
],
"no-var": "error",
"no-empty-function": "error",
"no-lonely-if": "error",
"no-new": "off",
"no-return-assign": "off",
"spaced-comment": "error",
yoda: "error",
"no-useless-constructor": "off",
"no-async-promise-executor": "off",
"no-new-func": "off",
"no-undef": "off",
"@next/next/no-html-link-for-pages": ["error", "."]
}
};
12 changes: 12 additions & 0 deletions client/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"jsxSingleQuote": true,
"bracketSameLine": false,
"trailingComma": "es5",
"singleQuote": true,
"bracketSpacing": true,
"semi": false,
"arrowParens": "always",
"endOfLine": "lf",
"tabWidth": 2,
"useTabs": false
}
156 changes: 156 additions & 0 deletions client/.stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"extends": [
"stylelint-config-prettier"
],
"rules": {
"value-list-comma-space-after": "always",
"selector-list-comma-space-after": "always-single-line",
"selector-list-comma-space-before": "never",
"block-opening-brace-newline-before": "never-single-line",
"block-opening-brace-space-before": "always",
"alpha-value-notation": [
"percentage",
{
"exceptProperties": [
"opacity",
"fill-opacity",
"flood-opacity",
"stop-opacity",
"stroke-opacity"
]
}
],
"at-rule-empty-line-before": [
"always",
{
"except": [
"blockless-after-same-name-blockless",
"first-nested"
],
"ignore": [
"after-comment"
]
}
],
"at-rule-no-vendor-prefix": true,
"color-function-notation": "modern",
"color-hex-length": "long",
"comment-empty-line-before": [
"always",
{
"except": [
"first-nested"
],
"ignore": [
"stylelint-commands"
]
}
],
"comment-whitespace-inside": "always",
"custom-property-empty-line-before": [
"always",
{
"except": [
"after-custom-property",
"first-nested"
],
"ignore": [
"after-comment",
"inside-single-line-block"
]
}
],
"declaration-block-no-redundant-longhand-properties": true,
"declaration-block-single-line-max-declarations": 1,
"declaration-empty-line-before": [
"always",
{
"except": [
"after-declaration",
"first-nested"
],
"ignore": [
"after-comment",
"inside-single-line-block"
]
}
],
"font-family-name-quotes": "always-where-recommended",
"function-name-case": "lower",
"function-url-quotes": "always",
"hue-degree-notation": "angle",
"length-zero-no-unit": [
true,
{
"ignore": [
"custom-properties"
]
}
],
"media-feature-name-no-vendor-prefix": true,
"number-max-precision": 4,
"property-no-vendor-prefix": true,
"rule-empty-line-before": [
"always-multi-line",
{
"except": [
"first-nested"
],
"ignore": [
"after-comment"
]
}
],
"selector-attribute-quotes": "always",
"selector-no-vendor-prefix": true,
"selector-pseudo-element-colon-notation": "double",
"selector-type-case": "lower",
"shorthand-property-no-redundant-values": true,
"value-keyword-case": "lower",
"value-no-vendor-prefix": [
true,
{
"ignoreValues": [
"box",
"inline-box"
]
}
],
"at-rule-no-unknown": true,
"block-no-empty": true,
"color-no-invalid-hex": true,
"comment-no-empty": true,
"custom-property-no-missing-var-function": true,
"declaration-block-no-duplicate-custom-properties": true,
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"font-family-no-duplicate-names": true,
"font-family-no-missing-generic-family-keyword": true,
"function-calc-no-unspaced-operator": true,
"function-linear-gradient-no-nonstandard-direction": true,
"function-no-unknown": true,
"keyframe-declaration-no-important": true,
"media-feature-name-no-unknown": true,
"named-grid-areas-no-invalid": true,
"no-descending-specificity": true,
"no-duplicate-at-import-rules": true,
"no-duplicate-selectors": true,
"no-empty-source": true,
"no-invalid-double-slash-comments": true,
"no-invalid-position-at-import-rule": true,
"no-irregular-whitespace": true,
"property-no-unknown": true,
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-element-no-unknown": true,
"selector-type-no-unknown": [
true,
{
"ignore": [
"custom-elements"
]
}
],
"string-no-newline": true,
"unit-no-unknown": true
}
}
10 changes: 3 additions & 7 deletions client/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import '@styles/globals.css'
import { Inter } from 'next/font/google'
import 'bootstrap/dist/css/bootstrap.css';
import "react-toastify/dist/ReactToastify.css";


import 'bootstrap/dist/css/bootstrap.css'
import 'react-toastify/dist/ReactToastify.css'

const inter = Inter({ subsets: ['latin'] })

Expand All @@ -14,10 +12,8 @@ export const metadata = {

export default function RootLayout({ children }) {
return (
<html lang="en">

<html lang='en'>
<body className={inter.className}>{children}</body>

</html>
)
}
33 changes: 15 additions & 18 deletions client/app/page.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
"use client"
import styles from '@styles/main.css'
import {Row,Container,Col,Stack } from "react-bootstrap"
'use client'
import { Row, Col } from 'react-bootstrap'
import ConfigSideNav from '@components/ConfigSideNav'
import MainContainer from '@components/MainContainer'
import { ToastContainer, toast } from 'react-toastify';
import { ToastContainer } from 'react-toastify'

export default function Home() {
return (
<>
<Row className=' pe-3 vh-100 overflow-hidden g-0'>
<Col className="side-bar-col" lg={3} xs={3}>
<div>
<div className='d-flex align-items-center justify-content-center py-4'><h3>PrivateGPT</h3></div>
<ConfigSideNav/>
</div>

<>
<Row className=' pe-3 vh-100 overflow-hidden g-0'>
<Col className='side-bar-col' lg={3} xs={3}>
<div>
<div className='d-flex align-items-center justify-content-center py-4'>
<h3>PrivateGPT</h3>
</div>
<ConfigSideNav />
</div>
</Col>
<Col lg={9} xs={9}
className="main-chat-col mt-3"
>
<MainContainer/>
<Col lg={9} xs={9} className='main-chat-col mt-3'>
<MainContainer />
</Col>
<ToastContainer />
</Row>

</>
</>
)
}
Loading