Update eslint configuration

This commit is contained in:
Michael Thomas 2022-02-06 22:01:32 -05:00
parent dd0222fb19
commit 42a2dced76
3 changed files with 2450 additions and 559 deletions

View File

@ -1,3 +1,6 @@
// Implements WordPress JS Coding Standards
// https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/
{ {
"root": true, "root": true,
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
@ -10,7 +13,8 @@
"extends": [ "extends": [
"plugin:react/recommended", "plugin:react/recommended",
"plugin:jsx-a11y/recommended", "plugin:jsx-a11y/recommended",
"plugin:jest/recommended" "plugin:jest/recommended",
"plugin:@typescript-eslint/recommended"
], ],
"env": { "env": {
"browser": false, "browser": false,
@ -142,13 +146,15 @@
"message": "Translate function arguments must be string literals." "message": "Translate function arguments must be string literals."
} }
], ],
"no-shadow": "error", "no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"no-undef": "error", "no-undef": "error",
"no-undef-init": "error", "no-undef-init": "error",
"no-unreachable": "error", "no-unreachable": "error",
"no-unsafe-negation": "error", "no-unsafe-negation": "error",
"no-unused-expressions": "error", "no-unused-expressions": "error",
"no-unused-vars": "error", "no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"no-useless-computed-key": "error", "no-useless-computed-key": "error",
"no-useless-constructor": "error", "no-useless-constructor": "error",
"no-useless-return": "error", "no-useless-return": "error",

View File

@ -4,6 +4,7 @@
"private": true, "private": true,
"main": "src/blocks.ts", "main": "src/blocks.ts",
"scripts": { "scripts": {
"lint:js": "wp-scripts lint-js 'src/**/*{.js,.jsx,.ts,.tsx}'",
"build:js": "webpack --mode=production", "build:js": "webpack --mode=production",
"build:sass": "sass src/styles:dist", "build:sass": "sass src/styles:dist",
"build": "npm run build:js && npm run build:sass", "build": "npm run build:js && npm run build:sass",

2996
yarn.lock

File diff suppressed because it is too large Load Diff