Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous Release 2.1.1 🙌 #18

Merged
merged 6 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributing

This is a small project, born out of frustration that the mature Ruby on Rails ecosystem does not provide a linter for `.js.erb` and `.html.erb` files.

I'm happy to accept your contributions! Please open an issue beforehand. This way, you get the chance to get feedback on your idea or a bug before you start working on the respective implementation/fix and therefore avoid wasting time on a PR that might not be merged.

As usual, common sense applies, so be respectful and constructive in your communication. PR comments will usually be short and concise. Please don't take them personally, it's a chance to learn and improve (both sides of course).
13 changes: 7 additions & 6 deletions DEV.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Some developer guidelines
# Developer guidelines

## Install as npm package locally to test

Expand All @@ -22,9 +22,10 @@ npm unlink eslint-plugin-erb

## 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.
We develop directly on `main`. Whenever a release is ready, we create a new release tag and publish to npm.

- Main branch: protected, only PRs allowed (tests must pass). Use squash commits (!)
- Finally: continuous release by creating a `release/*` branch and merging it into `main` via a PR.

## Create a new release (and publish to npm)

Expand All @@ -38,7 +39,7 @@ npm run bump-version -- [<newversion> | major | minor | patch]
```

- ⚠ Copy the version specifier from `package.json` into the `index.js` meta information object.
- 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`.
- Call the respective PR for the final changes "Continuous Release <version.number>". 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).
- Check that the release is available [here on npm](https://www.npmjs.com/package/eslint-plugin-erb). Enjoy ✌
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Splines
Copyright (c) 2023-2025 Splines

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ A zero-dependency plugin for [ESLint](https://eslint.org/).

![showcase-erb-lint-gif](https://github.com/Splines/eslint-plugin-erb/assets/37160523/623d6007-b4f5-41ce-be76-5bc0208ed636?raw=true)

> **Warning**
> v2.0.0 is breaking. We use the new ESLint flat config format. Use `erb:recommended-legacy` if you want to keep using the old `.eslintrc.js` format.

## Usage

### Install
Expand Down Expand Up @@ -150,7 +147,7 @@ export default [
<details>
<summary>Legacy: you can still use the old `.eslintrc.js` format</summary>

You can extend the `plugin:erb/recommended-legacy` config that will enable the ERB processor on all `.js.erb` files. **Note that instead of "plugin:erb/recommended", you now have to use "plugin:erb/recommended-legacy"**.
You can extend the `plugin:erb/recommended-legacy` config that will enable the ERB processor on all `.js.erb` files.

```js
// .eslintrc.js
Expand All @@ -176,6 +173,8 @@ module.exports = {

</details>

<br>

If you also want to lint **HTML code** in `.html.erb` files, you can use our preprocessor in conjunction with the amazing [`html-eslint`](https://html-eslint.org/) plugin. Install `html-eslint`, then add the following to your ESLint config file (flat config format):

```js
Expand Down Expand Up @@ -230,9 +229,6 @@ If you're using VSCode, you may find this `settings.json` options useful:
//////////////////////////////////////
// Files
//////////////////////////////////////
"files.exclude": {
"node_modules/": false,
},
"files.associations": {
"*.js.erb": "javascript"
},
Expand All @@ -258,4 +254,4 @@ console.log("You are lucky 🍀");
<% end %>
```

- No support for ESLint suggestions (but full support for Autofixes as shown in the GIF above)
- No support for ESLint _suggestions_ (but full support for _autofixes_ as shown in the GIF above)
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const processorHtml = {
const plugin = {
meta: {
name: "eslint-plugin-erb",
version: "2.1.0",
version: "2.1.1",
},
configs: {
"recommended": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-erb",
"version": "2.1.0",
"version": "2.1.1",
"description": "An ESLint plugin to lint JavaScript in ERB files (.js.erb)",
"license": "MIT",
"author": {
Expand Down
Loading