Skip to content

Commit

Permalink
feat: initted project
Browse files Browse the repository at this point in the history
  • Loading branch information
Opty1712 committed Feb 8, 2023
0 parents commit a2cc682
Show file tree
Hide file tree
Showing 21 changed files with 9,272 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": ["next/babel", "linaria/babel"],
"plugins": [
"@babel/plugin-proposal-optional-chaining",
"babel-plugin-ts-nameof"
]
}
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/

build/
coverage/
lib/
dist/
.next/
.linaria-cache/
60 changes: 60 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
],
"plugins": ["@typescript-eslint", "import", "react-hooks"],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"project": ["./tsconfig.eslint.json", "./tsconfig.json"],
"tsconfigRootDir": "./"
},
"env": {
"browser": true,
"node": true,
"es6": true,
"jest": true
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"no-console": [
"error",
{
"allow": ["warn", "error"]
}
],
"react/prop-types": 0,
"prefer-const": "error",
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "*", "next": "return" },
{ "blankLine": "always", "prev": "*", "next": "case" }
],
"@typescript-eslint/explicit-module-boundary-types": "off"
},
"overrides": [
{
"files": ["*.tsx", "*.ts"],
"rules": {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"react/react-in-jsx-scope": "off",
"@typescript-eslint/explicit-function-return-type": "off"
}
}
],
"globals": {
"nameof": "readonly"
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
### Project

.linaria-cache
.idea
*.swp

### Node

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# Dependency directories
node_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Next.js build output
.next
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org/
23 changes: 23 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Project
node_modules/
.*
!.babelrc
*.log
*.sh
*.tsbuildinfo
*.gz
yarn.lock
/lib
/dist
/coverage
/build
/coverage

# Images
*.svg
*.jpg
*.png
*.cur

# markdown
*.md
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "none"
}
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Test react app

1. Clone and run `yarn`
2. Create your own git branch
3. Modify styles for Root component
4. Create styled input, add some styles, add `label (visual name)` place it inside Root component + create state `value` and `onChange` handler ans pass them to the input:
* Tatiana - for Celsius's
* Alex - for Kelvin's
5. Find math formula to convert `Kelvin ←→ Celsius`
6. Find any other temperature systems and keep them + math formulas to convert.
7 changes: 7 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [2, 'always']
}
};
14 changes: 14 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const TEST_REGEX = '(\\.|/)(spec)\\.(jsx?|js?|tsx?|ts?)$';

module.exports = {
testRegex: TEST_REGEX,
transform: {
'^.+\\.(tsx?|js)$': 'babel-jest'
},
transformIgnorePatterns: [],
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
collectCoverage: true,
coverageReporters: ['lcov', 'html', 'text-summary'],
collectCoverageFrom: ['./src/**/*.tsx']
};
1 change: 1 addition & 0 deletions linaria.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { displayName: true };
5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
4 changes: 4 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const withLinaria = require('next-linaria');

module.exports = withLinaria({});
77 changes: 77 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "react-next-starter-kit",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"clean": "rimraf ./.next ./.linaria-cache ./coverage",
"build": "yarn clean && next build",
"dev": "yarn clean && next",
"start": "next start",
"lint": "yarn lint:ts && yarn lint:commitlint && yarn lint:prettier && yarn lint:eslint && yarn lint:stylelint",
"lint:ts": "tsc",
"lint:commitlint": "yarn commitlint -c commitlint.config.js",
"lint:eslint": "eslint --ext .js,.jsx,.ts,.tsx ./ --color --cache",
"lint:prettier": "prettier -c ./",
"lint:stylelint": "stylelint **/*.{ts,tsx}",
"test": "cross-env NODE_ENV=test jest",
"test:watch": "jest --watch",
"healthcheck": "yarn lint && yarn test && yarn build"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.{json,md}": [
"prettier --write"
],
"*.(ts,tsx)": [
"tsc --noEmit",
"prettier --write",
"stylelint",
"eslint --color --fix --cache"
]
},
"devDependencies": {
"@babel/core": "^7.13.15",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8",
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
"@commitlint/config-conventional": "^12.1.1",
"@testing-library/jest-dom": "^5.11.10",
"@testing-library/react": "^13.4.0",
"@types/jest": "^26.0.22",
"@types/ts-nameof": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"babel-plugin-ts-nameof": "^4.2.1",
"commitlint": "^12.1.1",
"cross-env": "^7.0.3",
"eslint": "^7.23.0",
"eslint-config-next": "^13.1.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^4.3.5",
"jest": "^26.6.3",
"lint-staged": "^10.5.4",
"next": "^13.1.1",
"next-linaria": "^0.11.0",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"stylelint": "^13.12.0",
"stylelint-config-standard": "^21.0.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-order": "^4.1.0",
"stylelint-processor-styled-components": "^1.10.0",
"ts-nameof": "^5.0.0"
},
"dependencies": {
"@callstack/react-theme-provider": "^3.0.8",
"linaria": "^4.1.11",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^4.9.4"
}
}
1 change: 1 addition & 0 deletions pages/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Example as default } from '../src/example';
3 changes: 3 additions & 0 deletions src/example.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const Example = () => {
return <></>;
};
27 changes: 27 additions & 0 deletions stylelint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
extends: ['stylelint-config-standard', 'stylelint-config-styled-components'],
processors: [
[
'stylelint-processor-styled-components',
{
parserPlugins: [
'jsx',
'objectRestSpread',
['decorators', { decoratorsBeforeExport: true }],
'classProperties',
'exportExtensions',
'asyncGenerators',
'functionBind',
'functionSent',
'dynamicImport',
'optionalCatchBinding',
'optionalChaining',
'nullishCoalescingOperator'
]
}
]
],
rules: {
'declaration-colon-newline-after': null
}
};
8 changes: 8 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig",
"include": ["**/*.js"],
"compilerOptions": {
"allowJs": true
},
"exclude": ["node_modules"]
}
22 changes: 22 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"target": "es6",
"module": "esnext",
"strict": true,
"forceConsistentCasingInFileNames": true,
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"esModuleInterop": true,
"incremental": true
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "types.d.ts", "**/*.ts", "**/*.tsx"]
}
Loading

0 comments on commit a2cc682

Please sign in to comment.