Skip to content
Closed
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
43 changes: 43 additions & 0 deletions .eslintrc.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious - why is there both an .eslintrc.json and an eslint.config.mjs? My understanding of eslint configuration is that there should be only one or the other.

This file is also invalid JSON.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually by migration doc , we need an .eslintrc.json, then by running the migration command , it converts the json to mjs . this is what i encountered

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand. But ultimately, there should only be a single config file for the tool - so which one should remain? Whichever remains, it must be a valid syntax for the tool to work.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"env": {
"browser": true,
"es6": true,
"amd": true,
"jquery": true
},
"ignorePatterns": ["static/js/vendor/zxcvbn.js"],
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@stylistic/js"
],
"rules": {




"@stylistic/js/comma-dangle": [
"error",
"always-multiline"
],
"@stylistic/js/indent": [
"off"

],
"@stylistic/js/linebreak-style": [
"error",
"unix"
],
"@stylistic/js/quotes": [
"off"

],
"@stylistic/js/semi": [
"off"

]
}
}
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-undef*/

module.exports = {
presets: [['@babel/preset-env', {targets: {node: 'current'}}]],
Expand Down
42 changes: 42 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import stylisticJs from "@stylistic/eslint-plugin-js";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [{
ignores: ["static/js/vendor/zxcvbn.js"],
}, ...compat.extends("eslint:recommended"), {
plugins: {
"@stylistic/js": stylisticJs,
},

languageOptions: {
globals: {
...globals.browser,
...globals.amd,
...globals.jquery,
},

ecmaVersion: "latest",
sourceType: "module",
},

rules: {

"@stylistic/js/comma-dangle": ["error", "always-multiline"],
"@stylistic/js/indent": ["off"],
"@stylistic/js/linebreak-style": ["error", "unix"],
"@stylistic/js/quotes": ["off"],
"@stylistic/js/semi": ["off"],
},
}];
Loading
Loading