diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 0203f7e1345c..000000000000 --- a/.eslintignore +++ /dev/null @@ -1,37 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2018 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Files # -######### -!.*.js -!.*.ts - -# Directories # -############### -build/ -reports/ -/dist/ - -# Node.js # -########### -/node_modules/ -!/**/node_modules/* - -# Git # -####### -.git* diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 0bfa6a817256..000000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,28 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var eslint = require( './etc/eslint/.eslintrc.overrides.js' ); - - -// EXPORTS // - -module.exports = eslint; diff --git a/eslint.config.cjs b/eslint.config.cjs index a54fb69ee677..ba7ee5345b12 100644 --- a/eslint.config.cjs +++ b/eslint.config.cjs @@ -33,12 +33,24 @@ var pluginExpectType = require( 'eslint-plugin-expect-type' ); var stdlibPlugin = require( './lib/node_modules/@stdlib/_tools/eslint/rules/scripts/plugin.js' ); var allRules = require( './etc/eslint/rules' ); var tsRules = require( './etc/eslint/rules/typescript.js' ); -var overrides = require( './etc/eslint/overrides' ); // VARIABLES // -var restrictedSyntaxConfig = overrides[ 1 ].rules[ 'no-restricted-syntax' ]; +var restrictedSyntaxConfig = [ 'error', + 'ArrowFunctionExpression', 'ClassBody', 'ClassDeclaration', + 'ClassExpression', 'DebuggerStatement', 'ExperimentalRestProperty', + 'ExperimentalSpreadProperty', 'LabeledStatement', 'RestElement', + 'SpreadElement', 'TaggedTemplateExpression', 'TemplateElement', + 'TemplateLiteral', 'WithStatement', 'YieldExpression', + 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', + 'JSXEmptyExpression', 'JSXExpressionContainer', 'JSXElement', + 'JSXClosingElement', 'JSXOpeningElement', 'JSXAttribute', + 'JSXSpreadAttribute', 'JSXText', 'ExportDefaultDeclaration', + 'ExportNamedDeclaration', 'ExportAllDeclaration', 'ExportSpecifier', + 'ImportDeclaration', 'ImportSpecifier', 'ImportDefaultSpecifier', + 'ImportNamespaceSpecifier' +]; var nonClonableRules = {}; var rules = {}; var val; diff --git a/etc/eslint/.eslintrc.benchmarks.js b/etc/eslint/.eslintrc.benchmarks.js deleted file mode 100644 index 713fed264ecc..000000000000 --- a/etc/eslint/.eslintrc.benchmarks.js +++ /dev/null @@ -1,139 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -// FIXME: remove the next line and uncomment the subsequent line once all remark JSDoc ESLint rules are completed -var copy = require( './../../lib/node_modules/@stdlib/utils/copy' ); - -// var copy = require( './utils/copy.js' ); -var defaults = require( './.eslintrc.js' ); - - -// MAIN // - -/** -* ESLint configuration. -* -* @namespace eslint -*/ -var eslint = copy( defaults ); - -/** -* Warn when using `String`, `Number`, and `Boolean` in place of primitives. -* -* @private -*/ -eslint.rules[ 'no-new-wrappers' ] = 'warn'; - -/** -* Override the limit for source code lines in a file. -* -* @private -*/ -eslint.rules[ 'max-lines' ] = [ 'warn', { - 'max': 1000, - 'skipBlankLines': true, - 'skipComments': true -}]; - -/** -* Override list of restricted syntax. -* -* @private -*/ -eslint.rules[ 'no-restricted-syntax' ] = [ 'error', - 'ArrowFunctionExpression', - 'ClassBody', - 'ClassDeclaration', - 'ClassExpression', - 'DebuggerStatement', - 'ExperimentalRestProperty', - 'ExperimentalSpreadProperty', - - // 'FunctionExpression', - 'LabeledStatement', - 'RestElement', - 'SpreadElement', - 'TaggedTemplateExpression', - 'TemplateElement', - 'TemplateLiteral', - 'WithStatement', - 'YieldExpression', - 'JSXIdentifier', - 'JSXNamespacedName', - 'JSXMemberExpression', - 'JSXEmptyExpression', - 'JSXExpressionContainer', - 'JSXElement', - 'JSXClosingElement', - 'JSXOpeningElement', - 'JSXAttribute', - 'JSXSpreadAttribute', - 'JSXText', - 'ExportDefaultDeclaration', - 'ExportNamedDeclaration', - 'ExportAllDeclaration', - 'ExportSpecifier', - 'ImportDeclaration', - 'ImportSpecifier', - 'ImportDefaultSpecifier', - 'ImportNamespaceSpecifier' -]; - -/** -* Do not require JSDoc comments. -* -* @private -*/ -eslint.rules[ 'require-jsdoc' ] = 'off'; - -/** -* Do not require `@private` annotations. -* -* @private -*/ -eslint.rules[ 'stdlib/jsdoc-private-annotation' ] = 'off'; - -/** -* Do not lint return annotation values in JSDoc comments. -* -* @private -*/ -eslint.rules[ 'stdlib/jsdoc-doctest' ] = 'off'; - -/** -* Do not enforce nested function elevation. -* -* @private -*/ -eslint.rules[ 'stdlib/no-unnecessary-nested-functions' ] = 'off'; - -/** -* Warn when using string concatenation in benchmark descriptions. -* -* @private -*/ -eslint.rules[ 'stdlib/no-bench-string-concat' ] = 'warn'; - - -// EXPORTS // - -module.exports = eslint; diff --git a/etc/eslint/.eslintrc.examples.js b/etc/eslint/.eslintrc.examples.js deleted file mode 100644 index afa9a472ffd5..000000000000 --- a/etc/eslint/.eslintrc.examples.js +++ /dev/null @@ -1,105 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -// FIXME: remove the next line and uncomment the subsequent line once all remark JSDoc ESLint rules are completed -var copy = require( './../../lib/node_modules/@stdlib/utils/copy' ); - -// var copy = require( './utils/copy.js' ); -var defaults = require( './.eslintrc.js' ); - - -// MAIN // - -/** -* ESLint configuration. -* -* @namespace eslint -*/ -var eslint = copy( defaults ); - -/** -* Warn when using `String`, `Number`, and `Boolean` in place of primitives. -* -* @private -*/ -eslint.rules[ 'no-new-wrappers' ] = 'warn'; - -/** -* Allow variables to be declared as needed. -* -* @private -*/ -eslint.rules[ 'vars-on-top' ] = 'off'; - -/** -* Allow using `console`. -* -* @private -*/ -eslint.rules[ 'no-console' ] = 'off'; - -/** -* Do not require JSDoc comments. -* -* @private -*/ -eslint.rules[ 'require-jsdoc' ] = 'off'; - -/** -* Do not require `@private` annotations. -* -* @private -*/ -eslint.rules[ 'stdlib/jsdoc-private-annotation' ] = 'off'; - -/** -* Do not lint return annotation values in JSDoc comments. -* -* @private -*/ -eslint.rules[ 'stdlib/jsdoc-doctest' ] = 'off'; - -/** -* Lint return annotation values. -* -* @private -*/ -eslint.rules[ 'stdlib/doctest' ] = 'error'; - -/** -* Do not require ordering of variable declarations inside of functions. -* -* @private -*/ -eslint.rules[ 'stdlib/vars-order' ] = 'off'; - -/** -* Enforce that last `require` is a relative path. -* -* @private -*/ -eslint.rules[ 'stdlib/require-last-path-relative' ] = 'error'; - - -// EXPORTS // - -module.exports = eslint; diff --git a/etc/eslint/.eslintrc.js b/etc/eslint/.eslintrc.js index 2c41be4d3051..2c56c5966ae1 100644 --- a/etc/eslint/.eslintrc.js +++ b/etc/eslint/.eslintrc.js @@ -55,15 +55,6 @@ eslint.env = require( './env' ); */ eslint.rules = require( './rules' ); -/** -* Overrides. -* -* @name overrides -* @memberof eslint -* @type {Array} -*/ -eslint.overrides = require( './overrides/repl_namespace.js' ); - /** * Parser options. * diff --git a/etc/eslint/.eslintrc.overrides.js b/etc/eslint/.eslintrc.overrides.js deleted file mode 100644 index 8b603bf87967..000000000000 --- a/etc/eslint/.eslintrc.overrides.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -// FIXME: remove the next line and uncomment the subsequent line once all remark JSDoc ESLint rules are completed -var copy = require( './../../lib/node_modules/@stdlib/utils/copy' ); - -// var copy = require( './utils/copy.js' ); -var defaults = require( './.eslintrc.js' ); - - -// MAIN // - -/** -* ESLint configuration. -* -* @namespace eslint -*/ -var eslint = copy( defaults ); - -/** -* Overrides. -* -* @name overrides -* @memberof eslint -* @type {Array} -*/ -eslint.overrides = require( './overrides' ); - - -// EXPORTS // - -module.exports = eslint; diff --git a/etc/eslint/.eslintrc.tests.js b/etc/eslint/.eslintrc.tests.js deleted file mode 100644 index edd9f4f9452b..000000000000 --- a/etc/eslint/.eslintrc.tests.js +++ /dev/null @@ -1,146 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -// FIXME: remove the next line and uncomment the subsequent line once all remark JSDoc ESLint rules are completed -var copy = require( './../../lib/node_modules/@stdlib/utils/copy' ); - -// var copy = require( './utils/copy.js' ); -var defaults = require( './.eslintrc.js' ); - - -// MAIN // - -/** -* ESLint configuration. -* -* @namespace eslint -*/ -var eslint = copy( defaults ); - -/** -* Allow empty functions. -* -* @private -*/ -eslint.rules[ 'no-empty-function' ] = 'off'; - -/** -* Warn when using `String`, `Number`, and `Boolean` in place of primitives. -* -* @private -*/ -eslint.rules[ 'no-new-wrappers' ] = 'warn'; - -/** -* Override the limit for source code lines in a file. -* -* @private -*/ -eslint.rules[ 'max-lines' ] = [ 'warn', { - 'max': 1000, - 'skipBlankLines': true, - 'skipComments': true -}]; - -/** -* Override list of restricted syntax. -* -* @private -*/ -eslint.rules[ 'no-restricted-syntax' ] = [ 'error', - 'ArrowFunctionExpression', - 'ClassBody', - 'ClassDeclaration', - 'ClassExpression', - 'DebuggerStatement', - 'ExperimentalRestProperty', - 'ExperimentalSpreadProperty', - - // 'FunctionExpression', - 'LabeledStatement', - 'RestElement', - 'SpreadElement', - 'TaggedTemplateExpression', - 'TemplateElement', - 'TemplateLiteral', - 'WithStatement', - 'YieldExpression', - 'JSXIdentifier', - 'JSXNamespacedName', - 'JSXMemberExpression', - 'JSXEmptyExpression', - 'JSXExpressionContainer', - 'JSXElement', - 'JSXClosingElement', - 'JSXOpeningElement', - 'JSXAttribute', - 'JSXSpreadAttribute', - 'JSXText', - 'ExportDefaultDeclaration', - 'ExportNamedDeclaration', - 'ExportAllDeclaration', - 'ExportSpecifier', - 'ImportDeclaration', - 'ImportSpecifier', - 'ImportDefaultSpecifier', - 'ImportNamespaceSpecifier' -]; - -/** -* Do not require JSDoc comments. -* -* @private -*/ -eslint.rules[ 'require-jsdoc' ] = 'off'; - -/** -* Do not require `@private` annotations. -* -* @private -*/ -eslint.rules[ 'stdlib/jsdoc-private-annotation' ] = 'off'; - -/** -* Do not lint return annotation values in JSDoc comments. -* -* @private -*/ -eslint.rules[ 'stdlib/jsdoc-doctest' ] = 'off'; - -/** -* Do not enforce nested function elevation. -* -* @private -*/ -eslint.rules[ 'stdlib/no-unnecessary-nested-functions' ] = 'off'; - -/** -* Allow the use of `undefined`. -* -* @private -*/ -eslint.rules[ 'no-undefined' ] = 'off'; - - -// EXPORTS // - -module.exports = eslint; diff --git a/etc/eslint/overrides/index.js b/etc/eslint/overrides/index.js deleted file mode 100644 index c7d6970bfa8c..000000000000 --- a/etc/eslint/overrides/index.js +++ /dev/null @@ -1,181 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var resolve = require( 'path' ).resolve; - - -// VARIABLES // - -var restrictedSyntaxConfig = [ 'error', - 'ArrowFunctionExpression', - 'ClassBody', - 'ClassDeclaration', - 'ClassExpression', - 'DebuggerStatement', - 'ExperimentalRestProperty', - 'ExperimentalSpreadProperty', - - // 'FunctionExpression', - 'LabeledStatement', - 'RestElement', - 'SpreadElement', - 'TaggedTemplateExpression', - 'TemplateElement', - 'TemplateLiteral', - 'WithStatement', - 'YieldExpression', - 'JSXIdentifier', - 'JSXNamespacedName', - 'JSXMemberExpression', - 'JSXEmptyExpression', - 'JSXExpressionContainer', - 'JSXElement', - 'JSXClosingElement', - 'JSXOpeningElement', - 'JSXAttribute', - 'JSXSpreadAttribute', - 'JSXText', - 'ExportDefaultDeclaration', - 'ExportNamedDeclaration', - 'ExportAllDeclaration', - 'ExportSpecifier', - 'ImportDeclaration', - 'ImportSpecifier', - 'ImportDefaultSpecifier', - 'ImportNamespaceSpecifier' -]; - - -// MAIN // - -/** -* ESLint overrides. -* -* @namespace overrides -*/ -var overrides = [ - { - 'files': [ '[a-z].js' ], - 'rules': { - 'stdlib/repl-namespace-order': 'error' - } - }, - { - 'files': [ '**/benchmark/*.js' ], - 'rules': { - 'no-new-wrappers': 'warn', - 'max-lines': [ 'warn', { - 'max': 1000, - 'skipBlankLines': true, - 'skipComments': true - }], - 'no-restricted-syntax': restrictedSyntaxConfig, - 'jsdoc/require-jsdoc': 'off', - 'stdlib/jsdoc-private-annotation': 'off', - 'stdlib/jsdoc-doctest': 'off', - 'stdlib/no-unnecessary-nested-functions': 'off' - } - }, - { - 'files': [ '**/examples/*.js' ], - 'rules': { - 'no-new-wrappers': 'warn', - 'vars-on-top': 'off', - 'no-console': 'off', - 'jsdoc/require-jsdoc': 'off', - 'stdlib/jsdoc-private-annotation': 'off', - 'stdlib/jsdoc-doctest': 'off', - 'stdlib/no-unnecessary-nested-functions': 'off', - 'stdlib/vars-order': 'off' - } - }, - { - 'files': [ '**/test/*.js' ], - 'rules': { - 'no-empty-function': 'off', - 'no-new-wrappers': 'warn', - 'max-lines': [ 'warn', { - 'max': 1000, - 'skipBlankLines': true, - 'skipComments': true - }], - 'no-restricted-syntax': restrictedSyntaxConfig, - 'jsdoc/require-jsdoc': 'off', - 'stdlib/jsdoc-private-annotation': 'off', - 'stdlib/jsdoc-doctest': 'off', - 'stdlib/no-unnecessary-nested-functions': 'off', - 'no-undefined': 'off' - } - }, - { - 'files': [ '*.md' ], - 'rules': { - 'eol-last': 'off', - 'indent': [ 'error', 4, { - 'SwitchCase': 0, - 'VariableDeclarator': 1, - 'outerIIFEBody': 1, - 'MemberExpression': 1, - 'FunctionDeclaration': { - 'body': 1, - 'parameters': 'off' - }, - 'FunctionExpression': { - 'body': 1, - 'parameters': 'off' - }, - 'CallExpression': { - 'arguments': 'off' - }, - 'ArrayExpression': 1, - 'ObjectExpression': 1, - 'flatTernaryExpressions': true - }], - 'no-console': 'off', - 'no-sync': 'off', - 'no-tabs': 'error', - 'no-undef': 'off', - 'no-unused-vars': 'off', - 'jsdoc/require-jsdoc': 'off', - 'stdlib/jsdoc-private-annotation': 'off', - 'stdlib/jsdoc-return-annotations-values': 'off', - 'stdlib/no-unnecessary-nested-functions': 'off', - 'stdlib/return-annotations-values': 'off', - 'strict': 'off', - 'vars-on-top': 'off', - 'node/no-unpublished-require': 'off' - } - }, - { - 'files': [ '*.d.ts' ], - 'extends': resolve( __dirname, '..', '.eslintrc.typescript.js' ) - }, - { - 'files': [ '**/test/*.ts' ], - 'extends': resolve( __dirname, '..', '.eslintrc.typescript.tests.js' ) - } -]; - - -// EXPORTS // - -module.exports = overrides; diff --git a/etc/eslint/overrides/repl_namespace.js b/etc/eslint/overrides/repl_namespace.js deleted file mode 100644 index f3a06a7af100..000000000000 --- a/etc/eslint/overrides/repl_namespace.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* ESLint overrides for REPL namespace files. -* -* @namespace overrides -*/ -var overrides = [ - { - 'files': [ '[a-z].js' ], - 'rules': { - 'stdlib/repl-namespace-order': 'error' - } - } -]; - - -// EXPORTS // - -module.exports = overrides;