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

feat(template): 升级初始化模板 #66

Merged
merged 1 commit into from
Sep 21, 2020
Merged
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: 1 addition & 1 deletion packages/rocketact/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rocketact",
"version": "0.2.6",
"version": "0.3.0",
"description": "Develop React projects with ease",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions packages/rocketact/template/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/**
build/**
@types/**
34 changes: 34 additions & 0 deletions packages/rocketact/template/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
settings: {
react: {
version: "detect", // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
extends: [
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
rules: {
"@typescript-eslint/ban-ts-comment": "warn", // ts-no-check
"@typescript-eslint/explicit-module-boundary-types": "off", // return
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ["*.js", "*.ts"],
rules: {
"@typescript-eslint/explicit-module-boundary-types": "warn",
},
},
],
};
3 changes: 1 addition & 2 deletions packages/rocketact/template/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules/
.vscode/
.DS_Store
**/.DS_Store

build/
build/
1 change: 1 addition & 0 deletions packages/rocketact/template/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
17 changes: 11 additions & 6 deletions packages/rocketact/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "rocketact-scripts start",
"build": "rocketact-scripts build",
"ts-check": "tsc --project tsconfig.json && tslint --config tslint.json --project tsconfig.json"
"lint": "eslint 'src/**/*.{js,ts,tsx}' --quiet --fix"
},
"repository": {
"type": "git",
Expand All @@ -25,13 +25,18 @@
"devDependencies": {
"@types/react": "^16.4.7",
"@types/react-dom": "^16.0.6",
"rocketact-scripts": "^1.0.0",
"tslint": "^5.12.0",
"typescript": "^3.2.2",
"tslint-config-prettier": "^1.17.0",
"@typescript-eslint/eslint-plugin": "^3.9.1",
"@typescript-eslint/parser": "^3.9.1",
"autoprefixer": "^9.3.1",
"eslint": "^7.7.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"rocketact-scripts": "^1.0.0",
"postcss-flexbugs-fixes": "^4.1.0",
"rocketact-plugin-polyfill": "^0.1.6"
"prettier": "^2.1.2",
"rocketact-plugin-polyfill": "^0.1.6",
"typescript": "^3.9.3"
},
"dependencies": {
"react": "^16.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from "react";
import logo from "./logo.svg";
import "./Welcome.scss";

const Welcome: React.SFC<{ message: string }> = props => {
const Welcome = (props: { message: string }) => {
return (
<div className="welcome-container">
<img src={logo} />
Expand Down
14 changes: 0 additions & 14 deletions packages/rocketact/template/tslint.json

This file was deleted.