From 706124c70ba24f3531a0810f427f1a88fb82bf0c Mon Sep 17 00:00:00 2001 From: daedalus <44623501+ComfortablyCoding@users.noreply.github.com> Date: Mon, 18 Sep 2023 23:34:46 -0400 Subject: [PATCH] chore(lint & format): remove unnecessary rules and update paths --- .eslintrc.backend.js | 8 ++++---- .eslintrc.frontend.js | 16 ++++------------ .eslintrc.js | 27 ++------------------------- .prettierrc.json | 2 +- package.json | 4 ++-- 5 files changed, 13 insertions(+), 44 deletions(-) diff --git a/.eslintrc.backend.js b/.eslintrc.backend.js index ed1c7a9..193f40e 100644 --- a/.eslintrc.backend.js +++ b/.eslintrc.backend.js @@ -1,8 +1,8 @@ module.exports = { + files: ['./server/**/*'], $schema: 'https://json.schemastore.org/eslintrc', - env: { - es6: true, - node: true, - }, extends: ['eslint:recommended', 'plugin:node/recommended', 'prettier'], + globals: { + strapi: 'readonly', + }, }; diff --git a/.eslintrc.frontend.js b/.eslintrc.frontend.js index f1f308c..6687e45 100644 --- a/.eslintrc.frontend.js +++ b/.eslintrc.frontend.js @@ -1,23 +1,15 @@ module.exports = { + files: ['./admin/**/*'], $schema: 'https://json.schemastore.org/eslintrc', - parser: '@babel/eslint-parser', - env: { - browser: true, - es6: true, - }, - plugins: ['react'], extends: ['eslint:recommended', 'plugin:react/recommended', 'prettier'], parserOptions: { - requireConfigFile: false, - ecmaVersion: 2018, + ecmaVersion: 'latest', + sourceType: 'module', ecmaFeatures: { jsx: true, }, - sourceType: 'module', - babelOptions: { - presets: ['@babel/preset-react'], - }, }, + env: { browser: true, es6: true }, settings: { react: { version: 'detect', diff --git a/.eslintrc.js b/.eslintrc.js index 3fd35f4..08f7fca 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,28 +1,5 @@ -const frontendESLint = require('./.eslintrc.frontend.js'); -const backendESLint = require('./.eslintrc.backend.js'); - module.exports = { $schema: 'https://json.schemastore.org/eslintrc', - parserOptions: { - ecmaVersion: 2018, - }, - rules: { - indent: ['error', 'tab'], - 'linebreak-style': ['error', 'unix'], - quotes: ['error', 'single'], - semi: ['error', 'always'], - }, - globals: { - strapi: 'readonly', - }, - overrides: [ - { - files: ['server/**/*'], - ...backendESLint, - }, - { - files: ['admin/**/*'], - ...frontendESLint, - }, - ], + root: true, + overrides: [require('./.eslintrc.backend.js'), require('./.eslintrc.frontend.js')], }; diff --git a/.prettierrc.json b/.prettierrc.json index a866370..5b0cfd0 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -7,5 +7,5 @@ "useTabs": true, "arrowParens": "always", "endOfLine": "lf", - "printWidth": 100 + "printWidth": 120 } diff --git a/package.json b/package.json index 163e09c..e3b7644 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "version": "2.2.3", "description": "A plugin for Strapi Headless CMS that provides the ability to trigger website builds manually, periodically or through model events.", "scripts": { - "lint": "eslint . --fix", - "format": "prettier --write **/*.{ts,js,json,yml}" + "lint:fix": "eslint --fix \"./**/*.{js,yml}\"", + "format:fix": "prettier --write \"./**/*.{js,json,yml,md}\"", }, "author": { "name": "@ComfortablyCoding",