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 globals + update configs #38

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
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
26 changes: 20 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,35 @@ on:
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node: [12.x, 10.x, 8.x]
os: [ubuntu-latest]
eslint: [6]
node: [12.22.0, 12, 14.17.0, 14, 16, 18]
include:
# On other platforms
- os: windows-latest
node: 18
- os: macos-latest
node: 18
# On the minimum supported ESLint/Node.js version
- eslint: 6.6.0
node: 12.22.0

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
uses: actions/checkout@v3
- name: Install Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install Packages
run: npm install
env:
CI: true
- name: Install ESLint@${{ matrix.eslint }}
run: npm install eslint@${{ matrix.eslint }}
- name: Test
run: npm test
- name: Send Coverage
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ npm install --save-dev eslint @mysticatea/eslint-plugin

### Requirements

- Node.js `^8.10.0` or newer versions.
- ESLint `^6.3.0` or newer versions.
- Node.js `^12.22.0 || ^14.17.0 || >=16.0.0` or newer versions.
- ESLint `^6.6.0` or newer versions.

## 📖 Usage

Expand Down
4 changes: 4 additions & 0 deletions lib/configs/+eslint-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@ module.exports = {
"@mysticatea/eslint-plugin/no-missing-placeholders": "error",
"@mysticatea/eslint-plugin/no-unused-placeholders": "error",
"@mysticatea/eslint-plugin/no-useless-token-range": "error",
"@mysticatea/eslint-plugin/prefer-object-rule": "error",
"@mysticatea/eslint-plugin/prefer-output-null": "error",
"@mysticatea/eslint-plugin/prefer-placeholders": "error",
"@mysticatea/eslint-plugin/prefer-replace-text": "error",
"@mysticatea/eslint-plugin/report-message-format": [
"error",
"[^a-z'\"{].*\\.$",
],
"@mysticatea/eslint-plugin/require-meta-docs-description":
"error",
"@mysticatea/eslint-plugin/require-meta-docs-url": [
"error",
{ pattern: rulesDocumentUrl },
],
"@mysticatea/eslint-plugin/require-meta-fixable": "error",
"@mysticatea/eslint-plugin/require-meta-schema": "error",
"@mysticatea/eslint-plugin/require-meta-type": "error",
"@mysticatea/eslint-plugin/test-case-property-ordering": [
"error",
Expand Down
6 changes: 6 additions & 0 deletions lib/configs/_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = {
"for-direction": "error",
"func-style": ["error", "declaration"],
"getter-return": "error",
"grouped-accessor-pairs": "error",
"init-declarations": "error",
"linebreak-style": ["error", "unix"],
"lines-between-class-members": "error",
Expand All @@ -47,11 +48,13 @@ module.exports = {
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-constant-condition": "error",
"no-constructor-return": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-div-regex": "error",
"no-dupe-args": "error",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-else-return": "error",
Expand Down Expand Up @@ -128,6 +131,7 @@ module.exports = {
"no-self-assign": ["error", { props: true }],
"no-self-compare": "error",
"no-sequences": "error",
"no-setter-return": "error",
"no-shadow": ["error", { builtinGlobals: true }],
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
Expand Down Expand Up @@ -173,6 +177,7 @@ module.exports = {
{ blankLine: "always", next: "function", prev: "*" },
{ blankLine: "always", next: "*", prev: "function" },
],
"prefer-exponentiation-operator": "error",
"prefer-promise-reject-errors": "error",
"prefer-regex-literals": "error",
quotes: ["error", "double", { avoidEscape: true }],
Expand Down Expand Up @@ -387,6 +392,7 @@ module.exports = {
],
},
],
"@mysticatea/eslint-comments/require-description": "off",

// prettier
"@mysticatea/prettier": [
Expand Down
20 changes: 19 additions & 1 deletion lib/configs/_browser-globals.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//
// DON'T EDIT THIS FILE WHICH WAS GENERATED BY './scripts/generate-browser-globals.js'.
//
"use strict"

module.exports = {
Expand All @@ -25,7 +27,7 @@ module.exports = {
AudioParam: "readonly",
AudioProcessingEvent: "readonly",
AudioScheduledSourceNode: "readonly",
"AudioWorkletGlobalScope ": "readonly",
AudioWorkletGlobalScope: "readonly",
AudioWorkletNode: "readonly",
AudioWorkletProcessor: "readonly",
BarProp: "readonly",
Expand All @@ -45,15 +47,24 @@ module.exports = {
CSSImportRule: "readonly",
CSSKeyframeRule: "readonly",
CSSKeyframesRule: "readonly",
CSSMatrixComponent: "readonly",
CSSMediaRule: "readonly",
CSSNamespaceRule: "readonly",
CSSPageRule: "readonly",
CSSPerspective: "readonly",
CSSRotate: "readonly",
CSSRule: "readonly",
CSSRuleList: "readonly",
CSSScale: "readonly",
CSSSkew: "readonly",
CSSSkewX: "readonly",
CSSSkewY: "readonly",
CSSStyleDeclaration: "readonly",
CSSStyleRule: "readonly",
CSSStyleSheet: "readonly",
CSSSupportsRule: "readonly",
CSSTransformValue: "readonly",
CSSTranslate: "readonly",
Cache: "readonly",
CacheStorage: "readonly",
CanvasCaptureMediaStreamTrack: "readonly",
Expand Down Expand Up @@ -86,6 +97,7 @@ module.exports = {
DOMPointReadOnly: "readonly",
DOMQuad: "readonly",
DOMRect: "readonly",
DOMRectList: "readonly",
DOMRectReadOnly: "readonly",
DOMStringList: "readonly",
DOMStringMap: "readonly",
Expand Down Expand Up @@ -113,6 +125,7 @@ module.exports = {
FontFace: "readonly",
FontFaceSetLoadEvent: "readonly",
FormData: "readonly",
FormDataEvent: "readonly",
GainNode: "readonly",
Gamepad: "readonly",
GamepadButton: "readonly",
Expand Down Expand Up @@ -242,6 +255,7 @@ module.exports = {
MediaKeyStatusMap: "readonly",
MediaKeySystemAccess: "readonly",
MediaList: "readonly",
MediaMetadata: "readonly",
MediaQueryList: "readonly",
MediaQueryListEvent: "readonly",
MediaRecorder: "readonly",
Expand Down Expand Up @@ -274,8 +288,10 @@ module.exports = {
OfflineAudioCompletionEvent: "readonly",
OfflineAudioContext: "readonly",
OffscreenCanvas: "writable",
OffscreenCanvasRenderingContext2D: "readonly",
Option: "readonly",
OscillatorNode: "readonly",
OverconstrainedError: "readonly",
PageTransitionEvent: "readonly",
PannerNode: "readonly",
Path2D: "readonly",
Expand Down Expand Up @@ -460,6 +476,7 @@ module.exports = {
StorageManager: "readonly",
StyleSheet: "readonly",
StyleSheetList: "readonly",
SubmitEvent: "readonly",
SubtleCrypto: "readonly",
TaskAttributionTiming: "readonly",
Text: "readonly",
Expand All @@ -476,6 +493,7 @@ module.exports = {
TouchEvent: "readonly",
TouchList: "readonly",
TrackEvent: "readonly",
TransformStream: "readonly",
TransitionEvent: "readonly",
TreeWalker: "readonly",
UIEvent: "readonly",
Expand Down
46 changes: 39 additions & 7 deletions lib/configs/_override-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,75 @@ module.exports = {
"@mysticatea/ts/adjacent-overload-signatures": "error",
"@mysticatea/ts/array-type": "error",
"@mysticatea/ts/await-thenable": "error",
"@mysticatea/ts/ban-ts-ignore": "error",
"@mysticatea/ts/class-name-casing": "error",
"@mysticatea/ts/ban-ts-comment": "error",
"@mysticatea/ts/class-literal-property-style": "error",
"@mysticatea/ts/comma-spacing": "error",
"@mysticatea/ts/consistent-type-assertions": "error",
"@mysticatea/ts/default-param-last": "error",
"@mysticatea/ts/dot-notation": "error",
"@mysticatea/ts/explicit-member-accessibility": "error",
"@mysticatea/ts/interface-name-prefix": "error",
"@mysticatea/ts/member-naming": "error",
"@mysticatea/ts/explicit-module-boundary-types": "error",
"@mysticatea/ts/init-declarations": "error",
"@mysticatea/ts/keyword-spacing": "error",
"@mysticatea/ts/lines-between-class-members": "error",
"@mysticatea/ts/method-signature-style": "error",
"@mysticatea/ts/naming-convention": "error",
"@mysticatea/ts/no-array-constructor": "error",
"@mysticatea/ts/no-base-to-string": "error",
"@mysticatea/ts/no-dupe-class-members": "error",
"@mysticatea/ts/no-dynamic-delete": "error",
"@mysticatea/ts/no-empty-interface": "error",
"@mysticatea/ts/no-extra-non-null-assertion": "error",
"@mysticatea/ts/no-extra-semi": "error",
"@mysticatea/ts/no-extraneous-class": "error",
"@mysticatea/ts/no-floating-promises": "error",
"@mysticatea/ts/no-for-in-array": "error",
"@mysticatea/ts/no-implied-eval": "error",
"@mysticatea/ts/no-inferrable-types": "error",
"@mysticatea/ts/no-invalid-this": "error",
"@mysticatea/ts/no-invalid-void-type": "error",
"@mysticatea/ts/no-misused-new": "error",
"@mysticatea/ts/no-misused-promises": "error",
"@mysticatea/ts/no-non-null-asserted-optional-chain": "error",
"@mysticatea/ts/no-parameter-properties": "error",
"@mysticatea/ts/no-require-imports": "error",
"@mysticatea/ts/no-this-alias": [
"error",
{ allowDestructuring: true },
],
"@mysticatea/ts/no-throw-literal": "error",
"@mysticatea/ts/no-unnecessary-boolean-literal-compare":
"error",
"@mysticatea/ts/no-unnecessary-qualifier": "error",
"@mysticatea/ts/no-unnecessary-type-arguments": "error",
"@mysticatea/ts/no-unnecessary-type-assertion": "error",
"@mysticatea/ts/no-unsafe-assignment": "error",
"@mysticatea/ts/no-unsafe-call": "error",
"@mysticatea/ts/no-unsafe-member-access": "error",
"@mysticatea/ts/no-unsafe-return": "error",
"@mysticatea/ts/no-unused-expressions": "error",
"@mysticatea/ts/no-unused-vars-experimental": "error",
"@mysticatea/ts/no-var-requires": "error",
"@mysticatea/ts/prefer-as-const": "error",
// https://github.com/typescript-eslint/typescript-eslint/issues/454
"@mysticatea/ts/prefer-function-type": "off",
"@mysticatea/ts/prefer-includes": "error",
"@mysticatea/ts/prefer-namespace-keyword": "error",
"@mysticatea/ts/prefer-nullish-coalescing": "error",
"@mysticatea/ts/prefer-optional-chain": "error",
"@mysticatea/ts/prefer-readonly-parameter-types": "error",
// https://github.com/typescript-eslint/typescript-eslint/issues/946
"@mysticatea/ts/prefer-readonly": "off",
"@mysticatea/ts/prefer-reduce-type-parameter": "off",
"@mysticatea/ts/prefer-regexp-exec": "error",
"@mysticatea/ts/prefer-string-starts-ends-with": "error",
"@mysticatea/ts/prefer-ts-expect-error": "off",
"@mysticatea/ts/restrict-plus-operands": "error",
"@mysticatea/ts/require-array-sort-compare": "error",
"@mysticatea/ts/restrict-template-expressions": "error",
"@mysticatea/ts/return-await": "error",
"@mysticatea/ts/space-before-function-paren": "error",
"@mysticatea/ts/switch-exhaustiveness-check": "error",
"@mysticatea/ts/triple-slash-reference": "error",
// なんか誤検知が多い...
"@mysticatea/ts/unbound-method": [
Expand All @@ -75,8 +110,6 @@ module.exports = {
],

// Replacements
camelcase: "off",
"@mysticatea/ts/camelcase": "error",
"no-empty-function": "off",
"@mysticatea/ts/no-empty-function": "error",
"no-useless-constructor": "off",
Expand All @@ -101,7 +134,6 @@ module.exports = {
"@mysticatea/ts/consistent-type-definitions": "off",
"@mysticatea/ts/explicit-function-return-type": "off", // I want but this is not so...
"@mysticatea/ts/func-call-spacing": "off", // favor of Prettier.
"@mysticatea/ts/generic-type-naming": "off",
"@mysticatea/ts/indent": "off", // favor of Prettier.
"@mysticatea/ts/member-delimiter-style": "off", // favor of Prettier.
"@mysticatea/ts/member-ordering": "off",
Expand Down
14 changes: 14 additions & 0 deletions lib/configs/_override-vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ module.exports = {
},
],
"@mysticatea/vue/comment-directive": "error",
"@mysticatea/vue/component-definition-name-casing": "error",
"@mysticatea/vue/component-tags-order": "error",
"@mysticatea/vue/dot-location": "error",
"@mysticatea/vue/eqeqeq": [
"error",
Expand All @@ -51,32 +53,44 @@ module.exports = {
},
},
],
"@mysticatea/vue/max-len": ["error", { tabWidth: 4 }],
"@mysticatea/vue/no-async-in-computed-properties": "error",
"@mysticatea/vue/no-boolean-default": "error",
"@mysticatea/vue/no-deprecated-scope-attribute": "error",
"@mysticatea/vue/no-deprecated-slot-attribute": "error",
"@mysticatea/vue/no-deprecated-slot-scope-attribute": "error",
"@mysticatea/vue/no-dupe-keys": "error",
"@mysticatea/vue/no-duplicate-attributes": "error",
"@mysticatea/vue/no-empty-pattern": "error",
"@mysticatea/vue/no-irregular-whitespace": "error",
"@mysticatea/vue/no-parsing-error": "error",
"@mysticatea/vue/no-reserved-component-names": "error",
"@mysticatea/vue/no-reserved-keys": "error",
"@mysticatea/vue/no-shared-component-data": "error",
"@mysticatea/vue/no-side-effects-in-computed-properties":
"error",
"@mysticatea/vue/no-static-inline-styles": "error",
"@mysticatea/vue/no-template-key": "error",
"@mysticatea/vue/no-textarea-mustache": "error",
"@mysticatea/vue/no-unsupported-features": "error",
"@mysticatea/vue/no-unused-vars": "error",
"@mysticatea/vue/object-curly-spacing": ["error", "always"],
"@mysticatea/vue/padding-line-between-blocks": "error",
"@mysticatea/vue/require-component-is": "error",
"@mysticatea/vue/require-direct-export": "error",
"@mysticatea/vue/require-name-property": "error",
"@mysticatea/vue/require-render-return": "error",
"@mysticatea/vue/require-v-for-key": "error",
"@mysticatea/vue/require-valid-default-prop": "error",
"@mysticatea/vue/return-in-computed-property": "error",
"@mysticatea/vue/sort-keys": "error",
"@mysticatea/vue/space-infix-ops": "error",
"@mysticatea/vue/space-unary-ops": "error",
"@mysticatea/vue/static-class-names-order": "error",
"@mysticatea/vue/v-on-function-call": "error",
"@mysticatea/vue/v-slot-style": "error",
"@mysticatea/vue/valid-template-root": "error",
"@mysticatea/vue/valid-v-bind-sync": "error",
"@mysticatea/vue/valid-v-bind": "error",
"@mysticatea/vue/valid-v-cloak": "error",
"@mysticatea/vue/valid-v-else-if": "error",
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-literal-call.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const LITERAL_AND_CLASS_TYPE = /^(?:(?:Array|Class|Object)Expression|(?:Template
module.exports = {
meta: {
docs: {
description: "Disallow a call of a literal.",
description: "disallow a call of a literal.",
category: "Possible Errors",
recommended: false,
url:
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-this-in-static.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
module.exports = {
meta: {
docs: {
description: "Disallow `this`/`super` in static methods",
description: "disallow `this`/`super` in static methods",
category: "Best Practices",
url:
"https://github.com/mysticatea/eslint-plugin/blob/v13.0.0/docs/rules/no-this-in-static.md",
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-use-ignored-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const DEFAULT_IGNORE_PATTERN = /^_[a-zA-Z]+$/u
module.exports = {
meta: {
docs: {
description: "Disallow a use of ignored variables.",
description: "disallow a use of ignored variables.",
category: "Stylistic Issues",
recommended: false,
url:
Expand Down
Loading