Skip to content

Commit

Permalink
⚒ tweak eslint setting
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed May 2, 2019
1 parent 3e4542f commit a3a6e41
Show file tree
Hide file tree
Showing 11 changed files with 424 additions and 408 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.js
Expand Up @@ -8,6 +8,22 @@ const version = require("./package.json").version

module.exports = {
extends: ["plugin:@mysticatea/es2015", "plugin:@mysticatea/+eslint-plugin"],
rules: {
"@mysticatea/eslint-plugin/test-case-property-ordering": [
"error",
[
"filename",
"code",
"output",
"options",
"parser",
"parserOptions",
"globals",
"env",
"errors",
],
],
},
overrides: [
{
files: ["**/rules/*.js"],
Expand Down
30 changes: 15 additions & 15 deletions tests/lib/rules/exports-style.js
Expand Up @@ -68,123 +68,123 @@ new RuleTester().run("exports-style", rule, {
invalid: [
{
code: "exports = {foo: 1}",
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'exports'. Use 'module.exports' instead.",
],
globals: { module: false, exports: true },
},
{
code: "exports.foo = 1",
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'exports'. Use 'module.exports' instead.",
],
globals: { module: false, exports: true },
},
{
code: "module.exports = exports = {foo: 1}",
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'exports'. Use 'module.exports' instead.",
],
globals: { module: false, exports: true },
},
{
code: "exports = module.exports = {foo: 1}",
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'exports'. Use 'module.exports' instead.",
],
globals: { module: false, exports: true },
},

{
code: "exports = {foo: 1}",
options: ["module.exports"],
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'exports'. Use 'module.exports' instead.",
],
globals: { module: false, exports: true },
},
{
code: "exports.foo = 1",
options: ["module.exports"],
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'exports'. Use 'module.exports' instead.",
],
globals: { module: false, exports: true },
},
{
code: "module.exports = exports = {foo: 1}",
options: ["module.exports"],
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'exports'. Use 'module.exports' instead.",
],
globals: { module: false, exports: true },
},
{
code: "exports = module.exports = {foo: 1}",
options: ["module.exports"],
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'exports'. Use 'module.exports' instead.",
],
globals: { module: false, exports: true },
},

{
code: "exports = {foo: 1}",
options: ["exports"],
globals: { module: false, exports: true },
errors: [
"Unexpected assignment to 'exports'. Don't modify 'exports' itself.",
],
globals: { module: false, exports: true },
},
{
code: "module.exports = {foo: 1}",
options: ["exports"],
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'module.exports'. Use 'exports' instead.",
],
globals: { module: false, exports: true },
},
{
code: "module.exports.foo = 1",
options: ["exports"],
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'module.exports'. Use 'exports' instead.",
],
globals: { module: false, exports: true },
},
{
code: "module.exports = exports = {foo: 1}",
options: ["exports"],
globals: { module: false, exports: true },
errors: [
"Unexpected access to 'module.exports'. Use 'exports' instead.",
"Unexpected assignment to 'exports'. Don't modify 'exports' itself.",
],
globals: { module: false, exports: true },
},
{
code: "exports = module.exports = {foo: 1}",
options: ["exports"],
globals: { module: false, exports: true },
errors: [
"Unexpected assignment to 'exports'. Don't modify 'exports' itself.",
"Unexpected access to 'module.exports'. Use 'exports' instead.",
],
globals: { module: false, exports: true },
},
{
code: "module.exports = exports = {foo: 1}; exports = obj",
options: ["exports", { allowBatchAssign: true }],
globals: { module: false, exports: true },
errors: [
"Unexpected assignment to 'exports'. Don't modify 'exports' itself.",
],
globals: { module: false, exports: true },
},
{
code: "exports = module.exports = {foo: 1}; exports = obj",
options: ["exports", { allowBatchAssign: true }],
globals: { module: false, exports: true },
errors: [
"Unexpected assignment to 'exports'. Don't modify 'exports' itself.",
],
globals: { module: false, exports: true },
},
],
})

0 comments on commit a3a6e41

Please sign in to comment.