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

feat: update templates for eslint v9 #179

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc.cjs

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm ci
run: npm install
aladdin-add marked this conversation as resolved.
Show resolved Hide resolved
- name: Lint files
run: npm run lint
test:
Expand All @@ -38,6 +38,6 @@ jobs:
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
run: npm install
- name: Run tests
run: npm test
4 changes: 2 additions & 2 deletions .github/workflows/release-please.yml
Expand Up @@ -29,9 +29,9 @@ jobs:
{ "type": "refactor", "section": "Chores", "hidden": false },
{ "type": "test", "section": "Chores", "hidden": false }
]
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org
Expand Down
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
package-lock = false
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -8,7 +8,7 @@ First and foremost, you must have [Node.js](https://nodejs.org/) and npm install

> **Requirements**
>
> - Node.js ^14.17.0 || ^16.0.0 || >= 18.0.0
> - Node.js ^18.18.0 || ^20.9.0 || >=21.1.0

You must also install Yeoman, if you don't have it installed already. To install Yeoman, you can run this command:

Expand Down
7 changes: 6 additions & 1 deletion app/index.js
Expand Up @@ -15,15 +15,20 @@ import PluginGenerator from "../plugin/index.js";
import { fileURLToPath } from "node:url";
import path from "node:path";

const __dirname = path.dirname(fileURLToPath(import.meta.url)); // eslint-disable-line no-underscore-dangle
/* eslint-disable no-underscore-dangle -- cjs convention */
const __dirname = path.dirname(fileURLToPath(import.meta.url));

const RULE_GENERATOR_PATH = path.join(__dirname, "..", "rule", "index.js");
const PLUGIN_GENERATOR_PATH = path.join(__dirname, "..", "plugin", "index.js");
/* eslint-enable no-underscore-dangle -- cjs convention*/

//------------------------------------------------------------------------------
// Constructor
//------------------------------------------------------------------------------

/**
* Represents a generator for creating ESLint plugins/rules.
*/
export default class extends Generator {
async prompting() {
const answers = await this.prompt({
Expand Down
15 changes: 15 additions & 0 deletions eslint.config.js
@@ -0,0 +1,15 @@
import globals from "globals";
import eslintConfigESLint from "eslint-config-eslint";

export default [
...eslintConfigESLint,
{
name: "generator-eslint/global-ignores",
ignores: ["temp/", "*/templates/*"]
},
{
name: "generator-eslint/test-files",
files: ["tests/**/*.js"],
languageOptions: { globals: globals.mocha }
}
];