{"id":371,"date":"2015-06-16T08:40:04","date_gmt":"2015-06-16T06:40:04","guid":{"rendered":"http:\/\/blog.thecodecampus.de\/?p=371"},"modified":"2023-12-20T20:04:51","modified_gmt":"2023-12-20T19:04:51","slug":"eslint-customizable-javascript-linting-tool-2","status":"publish","type":"post","link":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/","title":{"rendered":"ESLint &#8211; Customizable JavaScript linting tool (2)"},"content":{"rendered":"<p style=\"text-align: justify;\">In this second part of our article about ESLint we will dive into the most interesting feature of this tool: its customizability.<\/p>\n<p style=\"text-align: justify;\">You can find the first part of this article <a href=\"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-1\/\">here<\/a>.<\/p>\n<p style=\"text-align: justify;\">As background&#8217;s knowledge, in our introduction to the linting tools, we have discussed the most interesting linters and their pros and contras. After such overview we have started deepening into the initial features of ESLint, describing how to get started with the tool and how to lint our first JavaScript file. Hereby, alas, we have faced some\u00a0difficulties in linting a\u00a0JavaScript file because of the default settings of ESLint. This second part of the article explains exactly how to workaround such issue, exploiting the best of ESLint, via\u00a0its customizability.<\/p>\n<h5 style=\"text-align: justify;\">Table of Contents<\/h5>\n<ul style=\"text-align: justify;\">\n<li>ESLint &#8211; Fully customizable\u00a0code quality checker (part 2)\n<ul>\n<li>Rule reset and custom configuration<\/li>\n<li>ESLint config initialize<\/li>\n<li>Live Linting with an IDE<\/li>\n<li>Our first custom rule<\/li>\n<\/ul>\n<\/li>\n<li>Conclusions<\/li>\n<\/ul>\n<h2 style=\"text-align: justify;\">ESLint &#8211; Fully customizable\u00a0code quality checker (part 2)<\/h2>\n<p style=\"text-align: justify;\">In the following sections we will recovery the examples of the <a href=\"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-1\/\">first part of the article<\/a> and we will go ahead with the description of ESLint. Firstly we will discuss how to initialize our linting environment, in order to customize ESLint. Then we will discuss how to build our own linting rule&#8217;s configuration set. After that, we will introduce a\u00a0linting plugin, with which you can run ESLint &#8220;live&#8221;, within your IDE. As completion of our discussion we will introduce the building\u00a0of a completely customized linting rule and how to activate it.<\/p>\n<h4 style=\"text-align: justify;\">Rule reset and custom configuration<\/h4>\n<p style=\"text-align: justify;\">The behavior of ESLint can be controlled via the specification of a config file that can be proper of each single project. This means that, within you project you can specify the way ESLint works and, of course, adjust\u00a0this configuration to fit\u00a0the project itself.<\/p>\n<p style=\"text-align: justify;\">[As info, ESLint can be configured also via JavaScript comments, directly in your code, but we prefer the config file, since it is a global customization]<\/p>\n<p style=\"text-align: justify;\">The configuration file, as we can read from the ESLint webpage, can be a JSON or YAML file. This can be in the form of an <code>.eslintrc<\/code> file or an <code>eslintConfig<\/code> field in a <code>package.json<\/code> file, both of which ESLint will look for and read automatically.<\/p>\n<p style=\"text-align: justify;\">The effect of the configuration file is important. If you place a config in a folder, then ESLint will apply this to each file in the directory and all related subdirectories. But, pay attention, ESLint will always still\u00a0consider its default configuration file! Even\u00a0in presence of a custom one. This means that, if you configure a rule in your custom config file, then it will overwrite the default one. But, if you don\u00b4t mention a rule in your config, and this rule is active in the default, it will be anyway considered and computed.<\/p>\n<p style=\"text-align: justify;\">If you do not want ESLint to consider the default rules anymore, then you have three\u00a0options.\u00a0The first is to manually edit the global configuration file, toggling each rule that you don&#8217;t need. But doing this way you will edit the global behavior of the tool. The second is to use the following command:<\/p>\n<pre class=\"lang:default decode:true \">eslint --reset\r\n\/*Set all default rules to off - default: false*\/<\/pre>\n<p style=\"text-align: justify;\">But, like the first possibility, also this one is a no-return option, and you will be always required to configure ESLint for each occasion.<\/p>\n<p style=\"text-align: justify;\">Or, in alternative, you can use the following source as boilerplate to setup your own config: <a href=\"https:\/\/gist.github.com\/cletusw\/e01a85e399ab563b1236\">ESLint_Rule_Reset<\/a><\/p>\n<p style=\"text-align: justify;\">This starter configuration file contains the most of the default rules, and it has them already set to &#8220;0&#8221;, in order to give you\u00a0free hand about what to do in your customization. Just copy it and use it as .eslintrc of your project!<\/p>\n<h5 style=\"text-align: justify;\">ESLint config initialize<\/h5>\n<p style=\"text-align: justify;\">Hence, there are two best ways to start your customized setting in your project. The first is to copy the ESLint resetter file and use it within your project. The second is to write your own from scratch. In this last case, ESLint comes into help with a CLI command that creates the .eslintrc file for you:<\/p>\n<pre class=\"lang:default decode:true \">MacBook-Pro-Gianluca:$ eslint --init\r\n? What style of indentation do you use? Spaces\r\n? What quotes do you use for strings? Double\r\n? What line endings do you use? Unix\r\n? Do you require semicolons? Yes\r\n? Are you using ECMAScript 6 features? No\r\n? Where will your code run? Browser\r\n? Do you use JSX? No\r\n? What format do you want your config file to be in? JSON\r\nSuccessfully created .eslintrc file in \/Users\/Desktop\/testtest<\/pre>\n<p style=\"text-align: justify;\">The &#8211;init option prompts you a simple 8-steps wizard with some basilar questions about your usage of JavaScript and ESLint.\u00a0After a simple set of commands you will have your .eslintrc file, which will look like this:<\/p>\n<pre class=\"lang:default decode:true \">{\r\n    \"rules\": {\r\n        \"indent\": [\r\n            2,\r\n            4\r\n        ],\r\n        \"quotes\": [\r\n            2,\r\n            \"double\"\r\n        ],\r\n        \"linebreak-style\": [\r\n            2,\r\n            \"unix\"\r\n        ],\r\n        \"semi\": [\r\n            2,\r\n            \"always\"\r\n        ]\r\n    },\r\n    \"env\": {\r\n        \"browser\": true\r\n    }\r\n}<\/pre>\n<p style=\"text-align: justify;\">Starting from this basic configuration you can toggle the rules you need and adjust each setting to fit your requirements.<\/p>\n<h4 style=\"text-align: justify;\">Live Linting with an IDE<\/h4>\n<p style=\"text-align: justify;\">As complementary possibility, ESLint is able to run &#8220;live&#8221; within your editor or IDE, in order to integrate warnings and errors with the standard ones, coming from your program.\u00a0As example of this, we consider the configuration of ESLint with the IntelliJ IDEA IDE.<\/p>\n<p style=\"text-align: justify;\">We suppose that you have already downloaded NodeJS and the ESLint package via npm. At this point, go to IntelliJ IDEA&gt;Preferences (or, under MacOS, just hit Command+,).<\/p>\n<p style=\"text-align: justify;\">The preferences panel enables you (up.right)\u00a0to search in the preferences by a keyword: type &#8220;eslint&#8221;.<\/p>\n<p style=\"text-align: justify;\">Then you will be prompted to a screen similar to the one below:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2015\/06\/2015-06-03-11.29.25-am.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-351 size-full\" src=\"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2015\/06\/2015-06-03-11.29.25-am.png\" alt=\"ESlint in Intellij IDEA\" width=\"938\" height=\"473\" srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2015\/06\/2015-06-03-11.29.25-am.png 938w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2015\/06\/2015-06-03-11.29.25-am-300x151.png 300w\" sizes=\"auto, (max-width: 938px) 100vw, 938px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Now:<\/p>\n<ol style=\"text-align: justify;\">\n<li>Enable ESLint as Code Quality tool by toggling the checkbox.<\/li>\n<li>Check the path of your NodeJS interpreter (the default should be already configured)<\/li>\n<li>Tell IntelliJ where to find the ESLint package: if you downloaded it in the standard npm package folder, than copy the following path (don\u00b4t forget to replace your username): <code>\/Users\/your-username\/.npm-packages\/lib\/node_modules\/eslint<\/code><\/li>\n<li>If you want to specify a different configuration file you can either let ESLint looking automatically for the next .eslintrc file or specify one by yourself (this last option is useful when the .eslinrc file is in a path which is not on the road from the actual path to the root)\n<ul>\n<li>Note that, as already discussed, in either case, the settings in the configuration file will override the ESLint default settings.<\/li>\n<\/ul>\n<\/li>\n<li>In the last field you can specify a folder that contains custom rules. Such rules can be project specific and can be included in the ESLint workflow for specific need (more in the next paragraph).<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">After this configuration, ESLint will start running in your IDE, checking your JavaScript &#8220;live&#8221;.<\/p>\n<h4 style=\"text-align: justify;\">Our first custom rule<\/h4>\n<p style=\"text-align: justify;\">The most interesting feature of ESLint is, undoubtedly, the possibility to write own rules to validate and correct our code. ESLint comes with a simple and clear set of APIs to let you build your rule within a moment. What is important is just to follow the correct format ESLint understands!<\/p>\n<p style=\"text-align: justify;\">A good starting point to write our first rule is the following link to the ESLint page: <a href=\"https:\/\/eslint.org\/docs\/developer-guide\/working-with-rules.html\">Custom Rules<\/a>. Here we can find the basic specification of a rule; by joining such\u00a0code with our (consolidated) knowledge of ASTs the rule will be really easy to write and understand.<\/p>\n<p style=\"text-align: justify;\">In order to experiment the process of including a new rule, we make a concrete example. Let\u00b4s resume the rule of some paragraphs ago: &#8220;if the name of a variable starts with a capital letter then issue a warning&#8221;. This rule can also be considered useless, but, please, take it as example for the general concept.<\/p>\n<p style=\"text-align: justify;\">Now we can start step-by-step.<\/p>\n<ol style=\"text-align: justify;\">\n<li>The first point is to decide where to put our rules. In this regard we need to consider that we have two options. Either we create a custom folder (in our project or somewhere else) where we put our rules, or we write directly in the global rules&#8217; directory of ESLint. The first option is really good if you will share your rules with your projects (say, with other co-workers) and if you want to make your\u00a0rules not globally available. The second option is perfect if your rules shall be specific of your global environment. In the rest of the example we will consider the first option, because it involves more settings, since the second road consider the rule as if it would be built in the default of ESLint.<\/li>\n<li>Then, we create our folder, say\u00a0<code>eslintCustomRules\/<\/code> within our project and, there, a file named\u00a0<code>my-rule-no-capital.js<\/code><\/li>\n<li>Within our rule\u00b4s file a good starting point can be the following code:\n<pre class=\"lang:default decode:true\">\/**\r\n * @fileoverview A new rule for our ESLint - Preventing usage of capitalized variables\r\n * @author Gianluca Porcino\r\n * @copyright 2015 Gianluca Porcino. All rights reserved.\r\n *\/\r\n\"use strict\";\r\n\r\n\/\/------------------------------------------------------------------------------\r\n\/\/ Rule Definition\r\n\/\/------------------------------------------------------------------------------\r\n\r\nmodule.exports = function(context) {\r\n\r\n    return {\r\n        \"Interface\": function(node) {\r\n            \/\/ do something with node\r\n        }\r\n    };\r\n\r\n};\r\n\r\nmodule.exports.schema = [\r\n    \/\/ JSON Schema for rule options goes here\r\n];<\/pre>\n<p>The most interesting elements in this code are, of course,\u00a0<code>context<\/code> and <code>node<\/code>.\u00a0The <code>context<\/code> object contains additional functionalities that are helpful in the construction of a rule, letting you select and operate on each element of an AST\u00b4s <code>node<\/code>. The &#8220;context&#8221; of a rule is its environment and, as discussed, it is the subset the AST&#8217;s <code>nodes<\/code>\u00a0that we can select via the <code>interface<\/code>. The interface\u00b4s name, for us, is easy to locate, since we can get it either from the SpiderMonkey\u00b4s ESTree specifications, or from the visualization of our AST\u00b4s code in the visualizer (as discussed some paragraphs ago). In the case of our example, the interface\u00a0of our interest is the &#8220;Identifier&#8221;, since\u00a0we need to deal with the name of the variables.<\/p>\n<pre class=\"lang:default decode:true\">return {\r\n        \"Identifier\": applyMyRule\r\n    };<\/pre>\n<\/li>\n<li>At this point, we need to write our rule in the form of the function <code><code>applyMyRule\u00a0<\/code><\/code>\n<pre class=\"lang:default decode:true\">\/**\r\n * @fileoverview A new rule for our ESLint - Preventing usage of capitalized variables\r\n * @author Gianluca Porcino\r\n * @copyright 2015 Gianluca Porcino. All rights reserved.\r\n *\/\r\n\"use strict\";\r\n\r\n\/\/------------------------------------------------------------------------------\r\n\/\/ Rule Definition\r\n\/\/------------------------------------------------------------------------------\r\n\r\nmodule.exports = function(context) {\r\n    var MESSAGE = \"Variable Capitalized?!\";\r\n\r\n\r\n    function isCapital(key){\r\n        return ( \/^[A-Z]\/.test( key) );\r\n    }\r\n\r\n     function applyMyRule (node) {\r\n\r\n        if(isCapital(node.name)){\r\n            context.report(node, MESSAGE, { identifier: node.name });\r\n        };\r\n\r\n    }\r\n\r\n    return {\r\n        \"Identifier\": applyMyRule\r\n    };\r\n\r\n};\r\n\r\nmodule.exports.schema = [\r\n    \/\/ JSON Schema for rule options goes here\r\n];<\/pre>\n<p>In this code, <code>MESSAGE<\/code> is the detailed error (or warning) that ESLint will raise.\u00a0<code>isCapital<\/code> is simply a JavaScript function to control if a string starts with a capital letter via a regular expression. The most important element is the <code>context.report<\/code>, which is a method of the context able to detail the error with the <code>MESSAGE<\/code> we provided and the pointer to the node\u00b4s line in the code.<\/li>\n<li>The next step is to load your customized rule. If we are using the Live Code plugin in IntelliJ IDEA, we can specify our\u00a0<code>eslintCustomRules\/<\/code> folder in the &#8220;Additional rules directory&#8221; field (and our rule will be immediately available to be included in the configuration file). If we are not using IntelliJ we can however specify the rule\u00b4s folder via a CLI command:\n<pre class=\"lang:default decode:true\">eslint --rulesdir ~\/Code\/...\/eslintCustomRules\/ file.js<\/pre>\n<p>In order to load our rule in our config, all we need is the name of our\u00a0rule\u00b4s file: \u00a0<code>my-rule-no-capital.js<\/code>. Then we can load the rule in the config file as follows:<\/p>\n<pre class=\"lang:default decode:true\">\"rules\": {\r\n        \"my-rule-no-capital\": 1\r\n    }<\/pre>\n<\/li>\n<li>\u00a0Then we can test our rule, for instance against the following code\n<pre class=\"lang:default decode:true\">&lt;file.js&gt;\r\nvar A = 10,\r\n    b = 12,\r\n    c;\r\nif(A &lt; b){\r\n    c = \"b is bigger than a\";\r\n}else{\r\n    c = \"a is bigger than b\";\r\n}\r\nconsole.log(c);\r\n  \r\n------\r\n$ eslint --rulesdir ~\/Code\/...\/eslintCustomRules\/ file.js \r\n  1:4  warning  Variable Capitalized?!  my-rule-no-capital\r\n  4:3  warning  Variable Capitalized?!  my-rule-no-capital\r\n\r\n 2 problems (0 errors, 2 warnings)<\/pre>\n<p>Which shows the rule in action.<\/li>\n<\/ol>\n<h2 style=\"text-align: justify;\">Conclusions<\/h2>\n<p style=\"text-align: justify;\">ESLint is a great tool. It takes a little bit of setting to use it productively, but this depends upon\u00a0the multitude of code styles that exist. The possibility to configure each rule and to write new ones from scratch lets a great degree of freedom to each programmer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this second part of our article about ESLint we will dive into the most interesting feature of this tool: its customizability. You can find the first part of this article here. As background&#8217;s knowledge, in our introduction to the linting tools, we have discussed the most interesting linters and their pros and contras. After [&#8230;]<br \/><a class=\"meta-big\" href=\"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/\"> READ MORE<\/a><\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,79],"tags":[49,50,47,61,48,83],"class_list":["post-371","post","type-post","status-publish","format-standard","hentry","category-javascript","category-tooling","tag-code-quality","tag-cusotomization","tag-eslint","tag-javascript","tag-linting","tag-tooling"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ESLint - Customizable JavaScript linting tool (2) - Web Development Blog<\/title>\n<meta name=\"description\" content=\"ESLint: Customize and perfect your JavaScript code with this versatile tool for error correction and code improvement.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ESLint - Customizable JavaScript linting tool (2) - Web Development Blog\" \/>\n<meta property=\"og:description\" content=\"ESLint: Customize and perfect your JavaScript code with this versatile tool for error correction and code improvement.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Development tips and tricks - theCodeCampus Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-06-16T06:40:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-20T19:04:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2015\/06\/2015-06-03-11.29.25-am.png\" \/>\n<meta name=\"author\" content=\"theCodeCampus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"theCodeCampus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/\"},\"author\":{\"name\":\"theCodeCampus\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/276bbda2f8da73154f22fb652201cfbc\"},\"headline\":\"ESLint &#8211; Customizable JavaScript linting tool (2)\",\"datePublished\":\"2015-06-16T06:40:04+00:00\",\"dateModified\":\"2023-12-20T19:04:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/\"},\"wordCount\":1712,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.thecodecampus.de\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/2015-06-03-11.29.25-am.png\",\"keywords\":[\"Code Quality\",\"Cusotomization\",\"ESLint\",\"JavaScript\",\"Linting\",\"Tooling\"],\"articleSection\":[\"JavaScript\",\"Tooling\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/\",\"name\":\"ESLint - Customizable JavaScript linting tool (2) - Web Development Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.thecodecampus.de\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/2015-06-03-11.29.25-am.png\",\"datePublished\":\"2015-06-16T06:40:04+00:00\",\"dateModified\":\"2023-12-20T19:04:51+00:00\",\"description\":\"ESLint: Customize and perfect your JavaScript code with this versatile tool for error correction and code improvement.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.thecodecampus.de\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/2015-06-03-11.29.25-am.png\",\"contentUrl\":\"https:\\\/\\\/blog.thecodecampus.de\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/2015-06-03-11.29.25-am.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/eslint-customizable-javascript-linting-tool-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ESLint &#8211; Customizable JavaScript linting tool (2)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\",\"name\":\"Web Development tips and tricks - theCodeCampus Blog\",\"description\":\"Tips, tricks, and experiences about developing web and mobile applications with Angular, TypeScript, and Testing.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\",\"name\":\"theCodeCampus\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch.jpg\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch.jpg\",\"width\":156,\"height\":156,\"caption\":\"theCodeCampus\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/276bbda2f8da73154f22fb652201cfbc\",\"name\":\"theCodeCampus\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg\",\"caption\":\"theCodeCampus\"},\"description\":\"Our knowledge is not simply gained through reading - it is trained, tested and constantly being expanded. Because first and foremost, we are all developers at W11K. The know-how that we acquire here as developers, consultants and information architects flows immediately into our training courses and articles for theCodeCampus.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/showcase\\\/thecodecampus\\\/\"],\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ESLint - Customizable JavaScript linting tool (2) - Web Development Blog","description":"ESLint: Customize and perfect your JavaScript code with this versatile tool for error correction and code improvement.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/","og_locale":"en_US","og_type":"article","og_title":"ESLint - Customizable JavaScript linting tool (2) - Web Development Blog","og_description":"ESLint: Customize and perfect your JavaScript code with this versatile tool for error correction and code improvement.","og_url":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/","og_site_name":"Web Development tips and tricks - theCodeCampus Blog","article_published_time":"2015-06-16T06:40:04+00:00","article_modified_time":"2023-12-20T19:04:51+00:00","og_image":[{"url":"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2015\/06\/2015-06-03-11.29.25-am.png","type":"","width":"","height":""}],"author":"theCodeCampus","twitter_card":"summary_large_image","twitter_misc":{"Written by":"theCodeCampus","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/#article","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/"},"author":{"name":"theCodeCampus","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/276bbda2f8da73154f22fb652201cfbc"},"headline":"ESLint &#8211; Customizable JavaScript linting tool (2)","datePublished":"2015-06-16T06:40:04+00:00","dateModified":"2023-12-20T19:04:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/"},"wordCount":1712,"commentCount":0,"publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2015\/06\/2015-06-03-11.29.25-am.png","keywords":["Code Quality","Cusotomization","ESLint","JavaScript","Linting","Tooling"],"articleSection":["JavaScript","Tooling"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/","url":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/","name":"ESLint - Customizable JavaScript linting tool (2) - Web Development Blog","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/#primaryimage"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2015\/06\/2015-06-03-11.29.25-am.png","datePublished":"2015-06-16T06:40:04+00:00","dateModified":"2023-12-20T19:04:51+00:00","description":"ESLint: Customize and perfect your JavaScript code with this versatile tool for error correction and code improvement.","breadcrumb":{"@id":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/#primaryimage","url":"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2015\/06\/2015-06-03-11.29.25-am.png","contentUrl":"https:\/\/blog.thecodecampus.de\/wp-content\/uploads\/2015\/06\/2015-06-03-11.29.25-am.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.thecodecampus.de\/blog\/eslint-customizable-javascript-linting-tool-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.thecodecampus.de\/blog\/"},{"@type":"ListItem","position":2,"name":"ESLint &#8211; Customizable JavaScript linting tool (2)"}]},{"@type":"WebSite","@id":"https:\/\/www.thecodecampus.de\/blog\/#website","url":"https:\/\/www.thecodecampus.de\/blog\/","name":"Web Development tips and tricks - theCodeCampus Blog","description":"Tips, tricks, and experiences about developing web and mobile applications with Angular, TypeScript, and Testing.","publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.thecodecampus.de\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.thecodecampus.de\/blog\/#organization","name":"theCodeCampus","url":"https:\/\/www.thecodecampus.de\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch.jpg","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch.jpg","width":156,"height":156,"caption":"theCodeCampus"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/276bbda2f8da73154f22fb652201cfbc","name":"theCodeCampus","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg","caption":"theCodeCampus"},"description":"Our knowledge is not simply gained through reading - it is trained, tested and constantly being expanded. Because first and foremost, we are all developers at W11K. The know-how that we acquire here as developers, consultants and information architects flows immediately into our training courses and articles for theCodeCampus.","sameAs":["https:\/\/www.linkedin.com\/showcase\/thecodecampus\/"],"url":"https:\/\/www.thecodecampus.de\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/comments?post=371"}],"version-history":[{"count":14,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/371\/revisions"}],"predecessor-version":[{"id":2606,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/371\/revisions\/2606"}],"wp:attachment":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/media?parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/categories?post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/tags?post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}