Skip to content

Commit

Permalink
docs: add creating issue, filling PR template, using closing keywords…
Browse files Browse the repository at this point in the history
… to CONTRIBUTING.md

chore: add pull request template

chore: set up oxlint, add prettier script, update lint-staged config

docs: add lint and prettier scripts to contributing steps

chore: configure prettier vscode workspace settings

chore: configure recommended extensions for vscode workspace

ci: add steps for oxlint and eslint
  • Loading branch information
uday-rana committed Nov 1, 2024
1 parent d71472e commit 0ea10f7
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 9 deletions.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**Reference to Related Issue**

Fixes #

**Proposed Changes**

- [ ] Change 1
- [ ] Change 2
- [ ] Change 3
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npx prettier --check src/
- run: npx -y oxlint@0.10.3 --deny-warnings
- run: npx prettier --check .
- run: npx eslint
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"streetsidesoftware.code-spell-checker",
"esbenp.prettier-vscode",
"oxc.oxc-vscode"
]
}
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.organizeImports": "always"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.detectIndentation": false,
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"files.eol": "\n",
"files.insertFinalNewline": true,
"cSpell.words": ["codeshift", "openai", "oxlint", "smol"]
}
13 changes: 7 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ We welcome contributions to improve codeshift! Whether it's reporting a bug, sug
cd codeshift
```

3. Create a branch for your feature or fix
3. Create a branch for your change. Name your branch `issue-number` based on the issue number on GitHub. If your change doesn't have an issue, [create one](https://github.com/uday-rana/codeshift/issues).

```bash
git checkout -b feature/my-awesome-feature
git checkout -b issue-24
```

4. Make your changes

- Ensure that your code follows the existing style and conventions.
- Run tests and ensure everything is working as expected.
- Run `npm run lint` and `npm run prettier` to lint your code before committing changes.

5. Commit your changes

- Follow the Conventional Commits format for commit messages.
- Follow the [Conventional Commits](https://www.conventionalcommits.org/) format for commit messages.

```bash
git commit -m "feat(scope): add new feature description"
Expand All @@ -40,9 +40,10 @@ We welcome contributions to improve codeshift! Whether it's reporting a bug, sug
git push origin feature/my-awesome-feature
```

7. Submit a pull request
7. [Submit a pull request](https://github.com/uday-rana/codeshift/pulls)

- Go to the original repository, navigate to the "Pull Requests" tab, and open a new pull request.
- Provide a clear description of your changes, explaining the problem it solves or the feature it adds.
- Fill in the template. Link your issue using closing keywords, and provide a clear description of your changes.

## Guidelines

Expand Down
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import oxlint from "eslint-plugin-oxlint"

export default [
{ files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } },
{ languageOptions: { globals: globals.node } },
pluginJs.configs.recommended,
eslintConfigPrettier,
oxlint.configs["flat/recommended"]
];
148 changes: 148 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
"author": "Uday Rana",
"license": "MIT",
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
"**/*.": [
"oxlint",
"prettier --write --ignore-unknown",
"eslint"
]
},
"scripts": {
"start": "node ./src/index.js",
"lint": "eslint \"./src/**/*.js\" ",
"lint": "oxlint && eslint",
"prettier": "prettier --write .",
"prepare": "husky"
},
"dependencies": {
Expand All @@ -29,9 +34,11 @@
"@eslint/js": "^9.12.0",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-oxlint": "^0.10.1",
"globals": "^15.11.0",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"oxlint": "^0.10.3",
"prettier": "^3.3.3"
}
}

0 comments on commit 0ea10f7

Please sign in to comment.