From aaecfc3b64c367d56fa8652d008aed7bbcf6b1b9 Mon Sep 17 00:00:00 2001 From: Teppei Sato Date: Thu, 14 Sep 2023 22:43:12 +0900 Subject: [PATCH] fix!: drop `+closure` preset (#1040) --- +closure.js | 5 -- README.md | 18 ------ examples/closure-es2015/.eslintrc.json | 3 - examples/closure-es2015/.prettierrc.json | 1 - examples/closure-es2015/index.js | 33 ----------- examples/closure/.eslintrc.json | 3 - examples/closure/.prettierrc.json | 1 - examples/closure/index.js | 58 ------------------- lib/base.js | 2 - lib/closure.js | 54 ----------------- test/fixtures/.closure.eslintrc.json | 4 -- test/fixtures/closure.dot-location.pass.js | 4 -- test/fixtures/closure.id-match.fail.js | 1 - test/fixtures/closure.id-match.pass.js | 7 --- .../es5+closure.jsdoc#check-tag-names.pass.js | 12 ---- test/index.js | 1 - 16 files changed, 207 deletions(-) delete mode 100644 +closure.js delete mode 100644 examples/closure-es2015/.eslintrc.json delete mode 120000 examples/closure-es2015/.prettierrc.json delete mode 100644 examples/closure-es2015/index.js delete mode 100644 examples/closure/.eslintrc.json delete mode 120000 examples/closure/.prettierrc.json delete mode 100644 examples/closure/index.js delete mode 100644 lib/closure.js delete mode 100644 test/fixtures/.closure.eslintrc.json delete mode 100644 test/fixtures/closure.dot-location.pass.js delete mode 100644 test/fixtures/closure.id-match.fail.js delete mode 100644 test/fixtures/closure.id-match.pass.js delete mode 100644 test/fixtures/es5+closure.jsdoc#check-tag-names.pass.js diff --git a/+closure.js b/+closure.js deleted file mode 100644 index f6e7a884..00000000 --- a/+closure.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -module.exports = { - extends: ["./lib/closure.js"], -}; diff --git a/README.md b/README.md index 8643708c..4e871021 100644 --- a/README.md +++ b/README.md @@ -21,14 +21,6 @@ Only additional or orverwritten rules are specified. ### Install -#### for npm v6 - -```console -$ npm i -D eslint-config-teppeis eslint prettier -``` - -#### for npm v7+ - ```console $ npm i -D eslint-config-teppeis ``` @@ -154,16 +146,6 @@ This adds `browser` to `env`. } ``` -### For Closure Compiler coding style - -Extends `teppeis/+closure` after base config. - -```json -{ - "extends": ["teppeis/es2015", "teppeis/+closure"] -} -``` - ### Use Mocha for testing This enables mocha globals like `describe` or `it` in `**/test/*.js`. diff --git a/examples/closure-es2015/.eslintrc.json b/examples/closure-es2015/.eslintrc.json deleted file mode 100644 index b7a4e63f..00000000 --- a/examples/closure-es2015/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["../../es2015.js", "../../+closure.js"] -} diff --git a/examples/closure-es2015/.prettierrc.json b/examples/closure-es2015/.prettierrc.json deleted file mode 120000 index 49df5b68..00000000 --- a/examples/closure-es2015/.prettierrc.json +++ /dev/null @@ -1 +0,0 @@ -../../.prettierrc.closure.json \ No newline at end of file diff --git a/examples/closure-es2015/index.js b/examples/closure-es2015/index.js deleted file mode 100644 index db6579bd..00000000 --- a/examples/closure-es2015/index.js +++ /dev/null @@ -1,33 +0,0 @@ -/* eslint-disable no-unused-vars */ - -// don't use strict - -// global `goog` -goog.foo(); - -// allow foo['bar'] -goog['foo'](); - -// allow type casting -// TODO: add an option to allow only `foo = (foo)` -goog.n = /** @type {number} */ (goog.n); - -// allow @typedef expression statement -/** - * @typedef {number} - */ -goog.foo.bar; - -// allow `var_args` and `opt_foo` -function foo1(var_args) {} -function foo2(opt_foo) {} - -// allow @private `var foo_ = 0` -const foo_ = 0; - -// allow both `{'foo': 1}` and `{foo: 1}` -const obj = { - foo: 1, - 'bar': 2, -}; -/* eslint-enable no-unused-vars */ diff --git a/examples/closure/.eslintrc.json b/examples/closure/.eslintrc.json deleted file mode 100644 index d513b1be..00000000 --- a/examples/closure/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["../../es5.js", "../../+closure.js"] -} diff --git a/examples/closure/.prettierrc.json b/examples/closure/.prettierrc.json deleted file mode 120000 index 49df5b68..00000000 --- a/examples/closure/.prettierrc.json +++ /dev/null @@ -1 +0,0 @@ -../../.prettierrc.closure.json \ No newline at end of file diff --git a/examples/closure/index.js b/examples/closure/index.js deleted file mode 100644 index 519e5091..00000000 --- a/examples/closure/index.js +++ /dev/null @@ -1,58 +0,0 @@ -/* eslint-disable no-unused-vars */ - -// don't use strict - -// global `goog` -goog.foo(); - -// allow foo['bar'] -goog['foo'](); - -// allow type casting -// TODO: add an option to allow only `foo = (foo)` -goog.n = /** @type {number} */ (goog.n); - -// allow @typedef expression statement -/** - * @typedef {number} - */ -goog.foo.bar; - -// allow `var_args` and `opt_foo` -function foo1(var_args) {} -function foo2(opt_foo) {} - -// allow @private `var foo_ = 0` -var foo_ = 0; - -// allow both `{'foo': 1}` and `{foo: 1}` -var obj = { - foo: 1, - 'bar': 2, -}; - -// eslint-plugin-jsdoc - -/** - * @param {number} foo - * @return {boolean} - */ -function params(foo) { - return true; -} - -/** @define {boolean} */ -var definedConstantValue = true; - -/** - * require-param: overrideReplacesDocs: true - * @override - */ -function overrides(foo) {} - -/** - * require-param: augmentsExtendsReplacesDocs: true - * @extends {Error} - */ -function ext(foo) {} -/* eslint-enable no-unused-vars */ diff --git a/lib/base.js b/lib/base.js index 4817344e..898668c1 100644 --- a/lib/base.js +++ b/lib/base.js @@ -168,8 +168,6 @@ module.exports = { "jsdoc/require-hyphen-before-param-description": [2, "never"], "jsdoc/require-param-name": 2, "jsdoc/require-returns-check": 2, - // incompatible with closure style @extend - // maybe fixed in https://github.com/gajus/eslint-plugin-jsdoc/issues/305 "jsdoc/valid-types": 2, }, settings: { diff --git a/lib/closure.js b/lib/closure.js deleted file mode 100644 index 1a9995d4..00000000 --- a/lib/closure.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; - -module.exports = { - globals: { - goog: "readonly", - setUp: "readonly", - tearDown: "readonly", - assertNotNull: "readonly", - assertTrue: "readonly", - assertNotEquals: "readonly", - assertEquals: "readonly", - }, - env: { - browser: true, - }, - plugins: ["jsdoc"], - rules: { - // dot at tail of a line - "dot-location": [2, "object"], - // allow foo["bar"] - "dot-notation": 0, - // allow type casting - // TODO: add an option to allow only `foo = (foo)` - "no-self-assign": 0, - // allow @typedef expression statement - "no-unused-expressions": 0, - // allow `var_args` and `opt_foo` - camelcase: 0, - "id-match": [2, "^(?:var_args|(?:opt_)?[a-zA-Z0-9]+_?|[_A-Z0-9]+)$"], - // allow @private `var foo_ = 0` - "no-underscore-dangle": 0, - // don't use strict - strict: [2, "never"], - // allow both `{"foo": 1}` and `{foo: 1}` - "quote-props": 0, - - // # eslint-plugin-jsdoc - // https://github.com/gajus/eslint-plugin-jsdoc - "jsdoc/require-param": 2, - "jsdoc/require-param-type": 2, - "jsdoc/require-returns-type": 2, - // "require-returns" requires useless return statements for return type "undefined" #142 - // https://github.com/gajus/eslint-plugin-jsdoc/issues/142 - // 'jsdoc/require-returns': 2, - }, - settings: { - jsdoc: { - mode: "closure", - overrideReplacesDocs: true, - augmentsExtendsReplacesDocs: true, - implementsReplacesDocs: false, - }, - }, -}; diff --git a/test/fixtures/.closure.eslintrc.json b/test/fixtures/.closure.eslintrc.json deleted file mode 100644 index 6b326508..00000000 --- a/test/fixtures/.closure.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "root": true, - "extends": ["../../es5.js", "../../+closure.js"] -} diff --git a/test/fixtures/closure.dot-location.pass.js b/test/fixtures/closure.dot-location.pass.js deleted file mode 100644 index 2df78434..00000000 --- a/test/fixtures/closure.dot-location.pass.js +++ /dev/null @@ -1,4 +0,0 @@ -goog. - foo. - bar. - baz(); diff --git a/test/fixtures/closure.id-match.fail.js b/test/fixtures/closure.id-match.fail.js deleted file mode 100644 index 37286c37..00000000 --- a/test/fixtures/closure.id-match.fail.js +++ /dev/null @@ -1 +0,0 @@ -var _foo; diff --git a/test/fixtures/closure.id-match.pass.js b/test/fixtures/closure.id-match.pass.js deleted file mode 100644 index ec0b5963..00000000 --- a/test/fixtures/closure.id-match.pass.js +++ /dev/null @@ -1,7 +0,0 @@ -function foo(var_args) {} - -function bar(a, b, opt_cIsOptional) {} - -function Baz() {} -Baz.prototype.privateProp_ = 0; -var FOO_BAR_BAZ = 0; diff --git a/test/fixtures/es5+closure.jsdoc#check-tag-names.pass.js b/test/fixtures/es5+closure.jsdoc#check-tag-names.pass.js deleted file mode 100644 index c24955e6..00000000 --- a/test/fixtures/es5+closure.jsdoc#check-tag-names.pass.js +++ /dev/null @@ -1,12 +0,0 @@ -/** @type {number} */ -var id = 1; - -/** @define {boolean} */ -var ENABLE_DEBUG = true; - -/** - * @param {T} t - * @constructor - * @template T - */ -var Container = function(t) {}; diff --git a/test/index.js b/test/index.js index ff8e2b0e..cfa97308 100644 --- a/test/index.js +++ b/test/index.js @@ -44,7 +44,6 @@ describe("eslint-config-teppeis", () => { describeVerify("es2016", true); describeVerify("es2017", true); describeVerify("es2019", true); - describeVerify("es5+closure", false, "fixtures/.closure.eslintrc.json"); // describeVerify("+prettier", false, "fixtures/.prettier.eslintrc.json"); describeVerify("typescript", true, "fixtures/.typescript.eslintrc.json"); describeVerify("typescript-with-type", true, "fixtures/.typescript-with-type.eslintrc.json");