|
| 1 | +# How to contribute |
| 2 | + |
| 3 | +- [Getting help](#getting-help) |
| 4 | +- [Submitting bug reports](#submitting-bug-reports) |
| 5 | +- [Contributing code](#contributing-code) |
| 6 | + |
| 7 | +## Getting help |
| 8 | + |
| 9 | +Community discussion, questions, and informal bug reporting is done on |
| 10 | +the [discuss.CodeMirror forum](http://discuss.codemirror.net). |
| 11 | + |
| 12 | +## Submitting bug reports |
| 13 | + |
| 14 | +Report bugs on the |
| 15 | +[GitHub issue tracker](http://github.com/codemirror/dev/issues). |
| 16 | +Before reporting a bug, please read these pointers. |
| 17 | + |
| 18 | +- The issue tracker is for *bugs*, not requests for help. Questions |
| 19 | + should be asked on the [forum](http://discuss.codemirror.net). |
| 20 | + |
| 21 | +- Include information about the version of the code that exhibits the |
| 22 | + problem. For browser-related issues, include the browser, browser |
| 23 | + version, and operating system on which the problem occurred. |
| 24 | + |
| 25 | +- Mention very precisely what went wrong. "X is broken" is not a good |
| 26 | + bug report. What did you expect to happen? What happened instead? |
| 27 | + Describe the exact steps a maintainer has to take to make the |
| 28 | + problem occur. A screencast can be useful, but is no substitute for |
| 29 | + a textual description. |
| 30 | + |
| 31 | +- A great way to make it easy to reproduce your problem, if it can not |
| 32 | + be trivially reproduced on the website demos, is to submit a script |
| 33 | + that triggers the issue. The easiest way do do that is our |
| 34 | + [sandbox](https://codemirror.net/try/). |
| 35 | + |
| 36 | +## Contributing code |
| 37 | + |
| 38 | +Code written by "AI" language models (either partially or fully) is |
| 39 | +**not welcome**. Both because you cannot guarantee it's not parroting |
| 40 | +copyrighted content, and because it tends to be of low quality and a |
| 41 | +waste of time to review. |
| 42 | + |
| 43 | +- Make sure you have a [GitHub Account](https://github.com/signup/free) |
| 44 | + |
| 45 | +- Fork the relevant repository |
| 46 | + ([how to fork a repo](https://help.github.com/articles/fork-a-repo)) |
| 47 | + |
| 48 | +- Create a local checkout of the code. You can use the |
| 49 | + [dev repository](https://github.com/codemirror/dev) to |
| 50 | + easily check out all core modules. |
| 51 | + |
| 52 | +- Make your changes, and commit them |
| 53 | + |
| 54 | +- Follow the code style of the rest of the project (see below). |
| 55 | + |
| 56 | +- If your changes are easy to test or likely to regress, add tests in |
| 57 | + the relevant `test/` directory. Either put them in an existing |
| 58 | + `test-*.js` file, if they fit there, or add a new file. |
| 59 | + |
| 60 | +- Make sure all tests pass. Run `npm run test` to verify tests pass. |
| 61 | + |
| 62 | +- Submit a pull request ([how to create a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)). |
| 63 | + Don't put more than one feature/fix in a single pull request. |
| 64 | + |
| 65 | +By contributing code to CodeMirror you |
| 66 | + |
| 67 | + - Agree to license the contributed code under the project's [MIT |
| 68 | + license](https://github.com/CodeMirror/dev/blob/main/LICENSE). |
| 69 | + |
| 70 | + - Confirm that you have the right to contribute and license the code |
| 71 | + in question. (Either you hold all rights on the code, or the rights |
| 72 | + holder has explicitly granted the right to use it like this, |
| 73 | + through a compatible open source license or through a direct |
| 74 | + agreement with you.) |
| 75 | + |
| 76 | +### Coding standards |
| 77 | + |
| 78 | +- TypeScript, targeting an ES2018 runtime (i.e. don't use library |
| 79 | + elements added after ES2018). |
| 80 | + |
| 81 | +- 2 spaces per indentation level, no tabs. |
| 82 | + |
| 83 | +- No semicolons except when necessary. |
| 84 | + |
| 85 | +- Follow the surrounding code when it comes to spacing, brace |
| 86 | + placement, etc. |
| 87 | + |
| 88 | +- Brace-less single-statement bodies are encouraged (whenever they |
| 89 | + don't impact readability). |
| 90 | + |
| 91 | +- [getdocs](https://github.com/marijnh/getdocs-ts)-style doc comments |
| 92 | + above items that are part of the public API. |
| 93 | + |
| 94 | +- CodeMirror does *not* follow JSHint or JSLint prescribed style. |
| 95 | + Patches that try to 'fix' code to pass one of these linters will not |
| 96 | + be accepted. |
0 commit comments