Code Monkey home page Code Monkey logo

Comments (2)

Clearmist avatar Clearmist commented on September 16, 2024 1

create-react-app comes with eslint built-in so the framework is already doing some linting for us. :)

Regarding the basics of styling I suggest we add .editorconfig at the root with the following contents. This will auto-adjust these basic white-space related settings for anyone who uses the insanely popular EditorConfig for VS Code extension.

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

Regarding eslint this might be a good basis:

module.exports = {
  env: {
    // Set the environment to the browser.
    browser: true,
  },
  // Use the airbnb style rules.
  extends: 'airbnb',
  rules: {
    // Allow us to write long lines.
    'max-len': 'off',
    // Let us add console logging for debugging.
    'no-console': 'off',
  },
};

Regarding quotes styles I'm open to using whatever you guys decide. This is what I do normally:

Double quotes for property values and strings that need newline characters.
const text = "This sentence needs to end with a carriage return.\n";
<div className="container">

Backticks for every string that requires multiple lines or variable interpolation.

const multiLine = `This sentence has vertical

    whitespace. ${variable}`;

Single quotes for everything else.
import React from 'react';
const text = 'Slime Rancher 2';

from slime-rancher-2-interactive-map.

danhannigan avatar danhannigan commented on September 16, 2024

Love the idea of a contributing doc and adding the editorconfig.

I'd say some key points to hit in the doc start with a few questions:

  • Do you want to follow any common workflow, eg: Github Flow?
  • Do you want to enforce any naming conventions on branches: feat/ issue/ and so on?
  • Do you want to enforce tickets & discussion before work is done?
  • Any kind of tone or interactions you'd like to encourage ( I usually put a few ground rules in about no elitism, encouraging new coders, etc., but our audience might not overlap)
  • Possibly a section for no-code/low-code contributions and how they can do that. If they don't have GitHub - how to get one or contribute without one (if you're open to that)
  • Point out what was used to build the project: Create React App, Leaflet, Tailwind.
  • Who to flag for review if necessary
  • Document the deployment process & expectations

Outside of that, code styling isn't essential to document if you've got an editorconfig. Just briefly mention it and let folks know how to install the plugin.

from slime-rancher-2-interactive-map.

Related Issues (13)

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.