Skip to content

Commit

Permalink
Merge branch 'master' into prepare-14.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Sep 14, 2021
2 parents 832f38c + 64d409b commit e7d1dbc
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 30 deletions.
12 changes: 8 additions & 4 deletions .eslintrc.js
@@ -1,20 +1,22 @@
"use strict";

// eslint-disable-next-line no-undef -- Keep backward compatibility with CommonJS.
module.exports = {
parserOptions: {
ecmaVersion: 2019,
sourceType: "module",
},
env: {
es6: true,
node: true,
},
plugins: ["eslint-comments", "jest", "node", "sort-requires"],
extends: [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:node/recommended",
"plugin:node/recommended-module",
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:regexp/recommended",
"prettier",
],
rules: {
Expand Down Expand Up @@ -111,7 +113,9 @@ module.exports = {
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"sort-requires/sort-requires": "error",
strict: ["error", "global"],
"sort-imports": ["error", { allowSeparatedGroups: true }],

// Prefer code readability, e.g. `[0-9A-Za-z]`.
"regexp/prefer-d": "off",
},
};
18 changes: 8 additions & 10 deletions .github/workflows/nodejs.yml
Expand Up @@ -14,22 +14,19 @@ env:

jobs:
lint:
name: Lint on Node.js ${{ matrix.node }} and ${{ matrix.os }}
name: Lint

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

strategy:
matrix:
node: [12]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
node-version: "lts/*"
cache: npm

- name: Install latest npm
run: npm install --global npm@latest
Expand All @@ -48,15 +45,16 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12, 14]
node: [12, 14, 16]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm

- name: Install latest npm
run: npm install --global npm@latest
Expand Down
4 changes: 3 additions & 1 deletion __tests__/index.test.js
@@ -1,6 +1,7 @@
"use strict";

const config = require("../");
// eslint-disable-next-line no-undef -- Keep backward compatibility with CommonJS.
const config = require("../index");

it("test basic properties of config", () => {
expect(isObject(config.parserOptions)).toBeTruthy();
Expand All @@ -9,6 +10,7 @@ it("test basic properties of config", () => {
});

it("load config in ESLint to validate all rule syntax is correct", () => {
// eslint-disable-next-line no-undef -- Keep backward compatibility with CommonJS.
const CLIEngine = require("eslint").CLIEngine;

const cli = new CLIEngine({
Expand Down
1 change: 1 addition & 0 deletions index.js
@@ -1,3 +1,4 @@
"use strict";

// eslint-disable-next-line no-undef -- Keep backward compatibility with CommonJS.
module.exports = require("./.eslintrc.js");
179 changes: 165 additions & 14 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -29,7 +29,7 @@
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-sort-requires": "^2.1.0"
"eslint-plugin-regexp": "^1.1.0"
},
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit e7d1dbc

Please sign in to comment.