Skip to content

Commit

Permalink
Update configuration for ESM (#133)
Browse files Browse the repository at this point in the history
We are moving to ESM on the `stylelint/stylelint` repo:
stylelint/stylelint#5291
  • Loading branch information
ybiquitous committed Sep 14, 2021
1 parent c97d3ce commit 3076e99
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.js
@@ -1,18 +1,19 @@
"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",
"prettier",
Expand Down Expand Up @@ -111,7 +112,6 @@ 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 }],
},
};
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");
13 changes: 1 addition & 12 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -28,8 +28,7 @@
"eslint-config-prettier": "^8.3.0",
"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-node": "^11.1.0"
},
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit 3076e99

Please sign in to comment.