Git Product home page Git Product logo

eslint-config-drupal's Introduction

Why not ¯\_(ツ)_/¯

eslint-config-drupal's People

Contributors

frob avatar theodoreb avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

eslint-config-drupal's Issues

Remove React dependencies

I'm configuring ESLint form my custom Drupal theme and I want to use the same configuration as in Drupal core. This package is really helpful for that, but it depends on "eslint-config-airbnb" and it requires the installation of 'eslint-plugin-jsx-a11y', 'eslint-plugin-react', 'eslint-plugin-react-hooks'

Is it really necessary to use the package "eslint-config-airbnb" or is it possible to replace it with "eslint-config-airbnb-base", which doesn't require the the above mentioned dependencies?

How to configure the code editor correctly

How to configure the code editor correctly

First, this is not a problem, it is a question about the correct use of standards in an IDE integrated development environment.

I found myself trying to configure eslint for Drupal in PHPStorm, and it really is confusing.

ESLint Standards
For example, I have installed the node dependencies that comes in the web / core / package.json file

In PHPStorm in the Eslint settings I have configured,
web/core/node_modules/eslint, but with this module (eslint-config-drupal), I don't know if to configure it with node_modules/eslint which is in the root where I installed eslint-config-drupal. The same goes for prettier.

When I check the Drupal Js code standards using for example the command:

$[web/core] ./node_modules/.bin/eslint --no-ignore "../modules/custom/my_module/js/file.js"

As you can see I had to pass the --no-ignore argument in order to see the style errors.

NPM scripts

The package.json that brings the drupal core has some interesting commands that I am interested in using, such as transpiling ES6 to ES5, what the core does is transpile a file called file.es6.js to file.js in it. same place that the file is located.

In the drupal documentation I see that the command can be used apparently like this:

$[web/core] npm run build:js -- --file ../modules/custom/my_module/js/file.es6.js

But when doing it, I notice that the babel plugins do not process them and only show the same file, I only add a generic header text.

I understand that these commands are for the Drupal core, and if I temporarily copy my file.es6.js file to a location within the core, node with babel transpiles it correctly.

The only way that I have managed to transpile it is to copy the package.json, the core JS scripts, and use it in the root of the project. What I don't like is having everything duplicated.

I don't know if there is a way to use the standards, scripts, etc. that come from the core in a transparent way.

I have created a question in:
Configure JS standards correctly in Drupal

Greetings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.