-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See pull request #3.
- Loading branch information
Showing
33 changed files
with
2,399 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
|
||
jobs: | ||
mocha: | ||
name: Mocha | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [16, 17, 18, 19, 20, 21] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Install dependencies | ||
run: npm install | ||
env: | ||
CI: true | ||
- name: Run Mocha tests | ||
run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
"spec": "tests/**/*.js", | ||
"ignore": [ | ||
"tests/fixtures/**" | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Some developer guidelines | ||
|
||
|
||
## Merge strategies | ||
|
||
- Feature branches to `dev`: squash commit | ||
- Continuous Release from `dev` to `main`: standard merge commit | ||
- Hotfixes: branch off `main`, merge PR into `main` via squash commit, then merge back `main` to `dev` via standard merge commit. | ||
|
||
|
||
## Create a new release (and publish to npm) | ||
|
||
As this is only a small project, we haven't automated publishing to the NPM registry yet and instead rely on the following manual workflow. | ||
|
||
- Make sure the tests pass locally: `npm test` ✔ | ||
- Make another commit on the `dev` branch bumping the npm version in the `package.json`. For that, use: | ||
```sh | ||
npm run bump-version -- [<newversion> | major | minor | patch] | ||
``` | ||
- Once the `dev` branch is ready, open a PR (Pull request) called "Continuous Release <version.number>" and give it the "release" label. Merge this PR into `main`. | ||
- Create a new release via the GitHub UI and assign a new tag alongside that. | ||
- Fetch the tag locally (`git fetch`) and publish to npm via `npm run publish-final`. You probably have to login to npm first (`npm login`). | ||
- Enjoy ✌ Check that the release is available [here on npm](https://www.npmjs.com/package/eslint-plugin-erb). | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
env: | ||
mocha: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Testing | ||
|
||
|
||
## Run tests | ||
|
||
```sh | ||
npm test | ||
``` | ||
|
||
|
||
## Environment | ||
|
||
For reproduction, this is the ESLint configuration file used to generate the input messages for testing (see the `tests/fixtures/` folder. The files were manually renamed to end with `.js.erb` during this process. | ||
|
||
```js | ||
// .eslintrc.js | ||
// Starting with v9, this config will be deprecated in favor of the new | ||
// configuration files [1]. @stylistic is already ready for the new "flat config", | ||
// when it's time, copy the new config from [2]. | ||
// [1] https://eslint.org/docs/latest/use/configure/configuration-files-new | ||
// [2] https://eslint.style/guide/config-presets#configuration-factory | ||
|
||
// ////////////////////////////////////////// | ||
// Stylistic Plugin for ESLint | ||
// ////////////////////////////////////////// | ||
// see the rules in [3] and [4]. | ||
// [3] https://eslint.style/packages/js#rules | ||
// [4] https://eslint.org/docs/rules/ | ||
|
||
// eslint-disable-next-line no-undef | ||
require("@stylistic/eslint-plugin"); | ||
|
||
// eslint-disable-next-line no-undef | ||
module.exports = { | ||
"root": true, | ||
"parserOptions": { | ||
"ecmaVersion": 2024, | ||
"sourceType": "module" | ||
}, | ||
"env": { | ||
"browser": true, | ||
"jquery": true, | ||
"es6": true | ||
}, | ||
"plugins": [ | ||
"@stylistic", | ||
"erb" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@stylistic/all-extends", | ||
"plugin:erb/recommended" | ||
], | ||
"rules": { | ||
"no-unused-vars": "warn", | ||
"@stylistic/indent": ["error", 2], | ||
"@stylistic/quotes": ["error", "double"], | ||
"@stylistic/array-element-newline": ["error", "consistent"], | ||
"@stylistic/max-len": [ | ||
"error", { | ||
"code": 100, | ||
"ignoreUrls": true | ||
} | ||
] | ||
} | ||
}; | ||
``` |
Oops, something went wrong.