Git Product home page Git Product logo

vite-react-template's Introduction

Hello, I’m Eli! ✨

About me

🌱   Front-end developer   |   🕹️   Gamer   |   ✏️   Illustrator  

I love to create stuff :D

Techs and tools I like to work with

Some stats - (why not?)

ps.: instead of reading "Typescript" you can read React (that's because all my React projects is been written with Typescript lately :D)

vite-react-template's People

Contributors

elicavalheiro avatar

Watchers

 avatar

vite-react-template's Issues

ESLint support needed a tweak

ESLint does not run as configured

Update eslint to latest version and add missing dependencies

yarn upgrade eslint@latest
yarn add --dev eslint-plugin-react-hooks @typescript-eslint/parser eslint-plugin-jsx-a11y eslint-plugin-import

Modify the .eslintrc.json

  • update prettier config
  • fix a conflict with plugin for no-use-before-define rule
  • fix conflict with prettier for 'comma-dangle' rule (not sure I covered all cases)
{
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": [
    "plugin:@typescript-eslint/recommended",
    "prettier",
    "plugin:react/recommended",
    "airbnb"
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 12,
    "sourceType": "module"
  },
  "plugins": ["react-hooks", "prettier", "react", "@typescript-eslint"],
  "rules": {
    "no-use-before-define": "off",
    "@typescript-eslint/no-use-before-define": ["error"],
    "comma-dangle": ["error", "only-multiline"],
    "prettier/prettier": "error",
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn",
    "react/jsx-filename-extension": [1, { "extensions": [".tsx"] }],
    "import/prefer-default-export": "off",
    "import/extensions": [
      "error",
      "ignorePackages",
      {
        "ts": "never",
        "tsx": "never"
      }
    ]
  },
  "settings": {
    "import/resolver": {
      "typescript": {}
    }
  }
}

After making these changes, the app's ts files will have to be modified to pass the eslint rules

// main.tsx
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root')
);

// App.tsx
import React from 'react';

const App: React.FC = () => <div className="App">Vite - React Template</div>;

export default App;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.