Skip to content

Commit

Permalink
[TASK] Allow eslint execution from root folder
Browse files Browse the repository at this point in the history
With #101782 eslint project configuration was overwritten
to use a custom path.
eslint read the relative project configuration based
on the current execution folder instead of relative
to the eslintrc file.
This worked as long as eslint was executed from the
Build/ folder (execution folder == eslintrc folder).

As some tools execute eslint from the git root directory,
the configuration is now adapted to always resolve the
tsconfig file name as an absolute path based on the
configurations directory name.

Also overrideConfigFile is removed from Gruntfile.js
as .eslintrc.[json|js] is read by default and no
override is needed.

Resolves: #101846
Related: #101782
Releases: main, 12.4
Change-Id: I58a6322a74d388efb0da28d1d8e7375f491c7aea
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80841
Reviewed-by: Benjamin Franzke <ben@bnf.dev>
Tested-by: Benjamin Franzke <ben@bnf.dev>
Tested-by: core-ci <typo3@b13.com>
  • Loading branch information
bnf committed Sep 5, 2023
1 parent cc8c1e4 commit 66b45be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
5 changes: 0 additions & 5 deletions .editorconfig
Expand Up @@ -38,11 +38,6 @@ indent_size = 2
indent_size = 2
indent_style = tab

#.eslintrc.json
[.eslintrc.json]
indent_size = 2
indent_style = space

# stylelint
[.stylelintrc]
indent_size = 2
Expand Down
6 changes: 4 additions & 2 deletions Build/.eslintrc.json → Build/.eslintrc.js
@@ -1,12 +1,14 @@
{
const path = require('path');

module.exports = {
"root": true,
"env": {
"browser": true,
"es6": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.eslint.json"]
"project": [path.resolve(__dirname, "./tsconfig.eslint.json")]
},
"plugins": [
"@typescript-eslint",
Expand Down
3 changes: 1 addition & 2 deletions Build/Gruntfile.js
Expand Up @@ -275,8 +275,7 @@ module.exports = function (grunt) {
eslint: {
options: {
cache: true,
cacheLocation: './.cache/eslintcache/',
overrideConfigFile: '.eslintrc.json'
cacheLocation: './.cache/eslintcache/'
},
files: {
src: [
Expand Down

0 comments on commit 66b45be

Please sign in to comment.