BrookJeynes / slime-rancher-2-interactive-map

An interactive map for Slime Rancher 2.
https://sr2interactivemap.com
24 stars 7 forks source link

[Enhancement] Create a contribution.md #15

Open BrookJeynes opened 2 years ago

BrookJeynes commented 2 years ago

CC: @Clearmist @danhannigan

We should create a contribution.md so new people know how to contribute, any important information needed, and maybe code styling?

What things did you guys wish you knew or would've like to know before working on this? Do we have any specific code styles or important things to know? Currently I can only think of the debug .env file.

Clearmist commented 2 years ago

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';

danhannigan commented 2 years ago

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:

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.