Skip to content

Commit

Permalink
Update root to use a fla eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
diedexx committed Dec 13, 2024
1 parent 22f0461 commit e4b604f
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 266 deletions.
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

55 changes: 0 additions & 55 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion config/grunt/custom-tasks/sync-gutenberg-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function( grunt ) {
*
* @returns {void}
*/
function setVersion( file, pattern, version ) {
function setVersion( file, pattern, version ) {
const contents = grunt.file.read( file ).replace(
pattern,
version
Expand Down
37 changes: 37 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import globals from "globals";
import yoastConfig from "eslint-config-yoast";

/** @type {import('eslint').Linter.Config[]} */
export default [
{ ignores: [ "js/dist", "packages", "apps", "artifact", "vendor", "vendor_prefixed", ".yarn" ] },
...yoastConfig,
{
languageOptions: {
ecmaVersion: "latest",
globals: {
...globals.browser,
},
},
rules: {
// Deviate from the Yoast config to prohibit dangling commas in functions.
"stylistic/comma-dangle": [
"error",
{
functions: "never",
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
},
],
},
},
{
files: [ "*.config.js", "config/**", "Gruntfile.js" ],
languageOptions: {
globals: {
...globals.node,
},
},
},
];
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@
"dotenv": "^8.2.0",
"eslint": "^8.57.0",
"eslint-config-yoast": "^6.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.34.1",
"globals": "^15.13.0",
"grunt-git": "^1.0.14",
"grunt-prompt": "^1.3.3",
"grunt-shell": "^3.0.1",
Expand Down
Loading

0 comments on commit e4b604f

Please sign in to comment.