This is an automated email from the ASF dual-hosted git repository.
maxgekk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new f9aaeb4c1742 [SPARK-50586][BUILD] Use CommonJS format for ESLint
configuration file
f9aaeb4c1742 is described below
commit f9aaeb4c1742a305d77c442bf74ee9967b5f5a06
Author: Kousuke Saruta <[email protected]>
AuthorDate: Thu Dec 19 22:09:57 2024 +0300
[SPARK-50586][BUILD] Use CommonJS format for ESLint configuration file
### What changes were proposed in this pull request?
This PR proposes to use CommonJS format for ESLint configuration file
instead of JSON format.
### Why are the changes needed?
CommonJS format is just plain JavaScript so we can add comments to the
configuration file.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Temporarily modified some `.js` files and ran `dev/lint-js`, then the
linter detected violations.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #49198 from sarutak/eslint-js.
Authored-by: Kousuke Saruta <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
---
dev/eslint.js | 45 +++++++++++++++++++++++++++++++++++++++++++++
dev/eslint.json | 28 ----------------------------
dev/lint-js | 2 +-
3 files changed, 46 insertions(+), 29 deletions(-)
diff --git a/dev/eslint.js b/dev/eslint.js
new file mode 100644
index 000000000000..24b5170b436a
--- /dev/null
+++ b/dev/eslint.js
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+module.exports = {
+ "env": {
+ "browser": true,
+ "es6": true,
+ "jest": true
+ },
+ "extends": "eslint:recommended",
+ "rules": {
+ "indent": [
+ "error",
+ 2,
+ {
+ "SwitchCase": 1,
+ "MemberExpression": "off"
+ }
+ ],
+ "no-unused-vars": ["error", {"argsIgnorePattern": "^_ignored_.*"}]
+ },
+ "ignorePatterns": [
+ "*.min.js",
+ "sorttable.js",
+ "jquery.mustache.js",
+ "dataTables.rowsGroup.js"
+ ],
+ "parserOptions": {
+ "sourceType": "module"
+ }
+}
diff --git a/dev/eslint.json b/dev/eslint.json
deleted file mode 100644
index 29692696a6df..000000000000
--- a/dev/eslint.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "env": {
- "browser": true,
- "es6": true,
- "jest": true
- },
- "extends": "eslint:recommended",
- "rules": {
- "indent": [
- "error",
- 2,
- {
- "SwitchCase": 1,
- "MemberExpression": "off"
- }
- ],
- "no-unused-vars": ["error", {"argsIgnorePattern": "^_ignored_.*"}]
- },
- "ignorePatterns": [
- "*.min.js",
- "sorttable.js",
- "jquery.mustache.js",
- "dataTables.rowsGroup.js"
- ],
- "parserOptions": {
- "sourceType": "module"
- }
-}
diff --git a/dev/lint-js b/dev/lint-js
index f3f7eac4f6b8..1a94348b7430 100755
--- a/dev/lint-js
+++ b/dev/lint-js
@@ -45,7 +45,7 @@ if ! npm ls eslint > /dev/null; then
npm ci eslint
fi
-npx eslint -c "$SPARK_ROOT_DIR/dev/eslint.json" ${LINT_TARGET_FILES[@]} | tee
"$LINT_JS_REPORT_FILE_NAME"
+npx eslint -c "$SPARK_ROOT_DIR/dev/eslint.js" ${LINT_TARGET_FILES[@]} | tee
"$LINT_JS_REPORT_FILE_NAME"
lint_status=$?
if [ "$lint_status" = "0" ] ; then
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]