Giter Club home page Giter Club logo

linters-config's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linters-config's Issues

Dependency cycle detected import/no-cycle

The requirement of the project is to separate DOM from logic in different files.
Thus, I have these files:

default.js

import { submitForm } from './logic'

function displayTaskForm(key) {
  // function create form HTML content with btn submit.
  submitForm(addTaskbtn, key);
  return form;
}

export { displayTable };

logic.js

import { displayTable } from './default';

const submitForm = (btn, key) => {
  // Adds event listener to add input to the table && local storage
  displayTable(key) // shows the table content including recent input
  return btn;
}

export { submitForm };

And I have these errors:

default.js
1:1 error Dependency cycle detected import/no-cycle

logic.js
1:1 error Dependency cycle detected import/no-cycle

Could you advise how I could solve this issue? the problem is I have to split my DOM from the logic part. I don't see a way to link creating DOM based on if statement results.

Here is the original repository link

comparing WebHint vs HTMLHint

as discussed on slack, I made a deep look into whether HTMLHint has everything WebHint has, so here's the result:

p.s: I'm comparing the current rules set vs HTMLHint + inline style since that's what this is all about

Hint Description WebHint HTMLHint
button-type requires to use type attribute in a <button> tag available unavailable
disown-opener checks if the rel attribute is specified with both the noopener and noreferrer values (or only noopener if all the targeted browsers support it) on <a> and <area> elements that have target="_blank" and link to other origins available unavailable
html-checker validates the markup of a website against the Nu HTML checker available unavailable
meta-charset-utf-8 checks if the page explicitly declares the character encoding as utf-8 using a meta tag early in the document available unavailable
meta-viewport warns against not having a single viewport meta tag in the <head> with the proper value. available unavailable
inline-style-disabled forbid the use of inline stylings unavailable available

Sources: WebHint Hints || HTMLHint Rules

so I guess the best approach here, is to use both, HTMLHint has some more useful rules that can be used as well (check sources)

EXTEND STYLELINT TO RECOGNIZE NEW METHODS

While working on the ror-social-scaffold project, I came across an issue where Stylelint would flag the fit-content value for the width property as an error. I researched it and found out it was a known issue. I opened an issue on the ror-social-scaffold project here. Later, I fixed the issue via this pull request. One of the suggestions by @bolah2009 and @uryelah was to open an issue on the same here so we can extend the solution to this repo. If it's okay with the maintainers we can extend the CSS dictionary in the .stylelintrc.json file here as well.

Github action unable to call Class and Module from inside Rspec file

Github action unable to call Class and Module from inside Rspec file. This problem only happens on github. Code works fine in local machine.

     NoMethodError:
       undefined method `after_colon_check' for AfterColon:Module
     # ./spec/after_colon_spec.rb:18:in `block (3 levels) in <top (required)>'

  3) AfterColon#after_colon_check It returns an empty array if the line passed conly contains a psuedocode
     Failure/Error: AfterColon.after_colon_check(file_details[113], 113, error_array)
     
     NoMethodError:
       undefined method `after_colon_check' for AfterColon:Module
     # ./spec/after_colon_spec.rb:23:in `block (3 levels) in <top (required)>'

  4) AfterColon#after_colon_check It returns an empty array if the line passed only contains a psuedocode
     Failure/Error: AfterColon.after_colon_check(file_details[110], 110, error_array)
     
     NoMethodError:
       undefined method `after_colon_check' for AfterColon:Module
     # ./spec/after_colon_spec.rb:28:in `block (3 levels) in <top (required)>'

Works if I use the include Classname/Modulename

Linter check doesn't work with set permissions for OOP project build on Windows OS

In the first milestone of the Ruby OOP project, where the bin/main file needs to be made executable with a shebang line the linter outputs errors if the project was built on a WIndows OS machine:
Screenshot_2020-10-16 jcy2704 oop_ruby
Changing the .git/config filemode option to true doesn't seem to work.

The check only passes if the line: chmod 755 bin/main is passe to the linters config file inside github/workflows before running -f .rubocop.yml
Screenshot_2020-10-16 Wtf by uryelah · Pull Request #3 · jcy2704 oop_ruby

What would be a better way to have the linters pass checks for Windows users without changing the config files?
@shshamim63

Update HTML/CSS Documentation

Add to the documentation a bullet point for this:

npm init

before installing the linters. Otherwise, there may be conflicts on each run of the linters.

Eslint version in the linter setup clashes with the version installed by create-react-app

The linter setup needs us to install eslint version 6.8.0 but create-react-app uses eslint version 7.11.0
So the linter setup removes the newer version of eslint, which causes an error on running yarn start.

Steps to recreate

  1. Create a new project using create-react-app
  2. Install linter packages using the instructions here
  3. Run the project locally: yarn start

This would then show you the following error screen

$ react-scripts start

There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

  "eslint": "^7.11.0"

Don't try to install it manually: your package manager does it automatically.
However, a different version of eslint was detected higher up in the tree:

  /home/keshavchakravarthy/repos/react/calculator/node_modules/eslint (version: 6.8.0) 

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "eslint" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:

  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
     This may help because npm has known issues with package hoisting which may get resolved in future versions.

  6. Check if /home/keshavchakravarthy/repos/react/calculator/node_modules/eslint is outside your project directory.
     For example, you might have accidentally installed something in your home folder.

  7. Try running npm ls eslint in your project folder.
     This will tell you which other package (apart from the expected react-scripts) installed eslint.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Stickler-ci Stylelint not doing any check for CSS without config file

Using the Stickler-ci configuration with Stylelint, no matter what CSS file I throw in, all the checks always pass, even if there are errors.

You can take a look at this test repository and the pull request.

If I add Csslint to stickler-ci, if works fine (but I get why it was removed on #1): https://github.com/archemiro/stickler-ci-stylelint-test/pull/2

My guess is that there is a configuration file needed in order to Stylelint to work, as in the docs example: https://stickler-ci.com/docs#stylelint.

You can check this third pull request that adds the stylelint-config-recommended and works as expected: https://github.com/archemiro/stickler-ci-stylelint-test/pull/3.

Eslint import plugin version not working in github actions for REACT

There is a problem with the GitHub actions that make the eslint linter run fail every time when working with REACT.
The error given by GitHub is the following:

image

After looking for a solution I found that the problem was with the eslint import plugin version 2.20 that needs a different parameter for the no-cycle rule. This error happens locally as well.

When the version is changed for 2.22, the error is fixed in both environments.

This only happens with the code created by the create-react-app command, regular JS code is not affected by it

linting errors in the Gemfile

Rubocop raises some linting errors in the Gemfile, specifically

Gemfile:43:28: C: Style/SymbolArray: 
Use %i or %I for an array of symbols. 
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]

Gemfile:64:31: C: Style/SymbolArray: 
Use %i or %I for an array of symbols. 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Attempting to fix, results in this error on bundle update

There was an error parsing Gemfile: :mri is not a valid platform. ...

Maybe Gemfile should be excluded from .rubocop.yml ?

Wrong namespace error in `.rubocop.yml`

There is a problem with .rubocop.yml configuration for Ruby projects.
Am getting this error .rubocop.yml: Metrics/LineLength has the wrong namespace - should be Layout.
The issue has been fixed by modifying

Metrics/LineLength:
  Max: 120

to

Layout/LineLength:
  Max: 120

ESLINT "no-use-before-define" should be disabled

In JavaScript, prior to ES6, variable and function declarations are hoisted to the top of a scope, so it’s possible to use identifiers before their formal declarations in code. This can be confusing and some believe it is best to always declare variables and functions before using them.

reference stackoverflow

Like this:

"rules": {
    "no-shadow": "off",
    "no-param-reassign": "off",
    "eol-last": "off",
    "arrow-parens": "off",
    "no-use-before-define":"off"
  },

Since we are going with the ES6 format, coders should be given the flexibility to extend their creativity hence why the no-use-before-define need to be disabled

Please let me know if there is a reason for it not to be disabled

Add aditional module on linters.yml for React-redux

I had an issue concerning this, the reason was a module that wasn't in the linter.yml config, this was @babel/preset-env.
When I worked on react calculator test, I had issues regarding babel and jest, the solution was to install some babel modules on my project. The test works perfectly (linters locally too) but I had issues with linters in the GitHub page only, locally works well.

I add this module on my linters.yml and I solved the issue, I add the PR here for inspection:
my PR

image
image

Getting error while installing eslint-config-airbnb plugin for ESLint.

During the linter config in my redux based project I am facing the problem related to Eslint config installation.

When I run npm install --save-dev [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] , I am getting this error:

Debugger attached.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"7.11.x" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^5.16.0 || ^6.8.0" from [email protected]
npm ERR! node_modules/eslint-config-airbnb
npm ERR!   dev eslint-config-airbnb@"18.1.x" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/dere/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dere/.npm/_logs/2021-03-22T19_38_55_657Z-debug.log
Waiting for the debugger to disconnect...

I have created the project with create-react-app script. Even to solve the problem, I removed package-lock.json file and run npm install again too. It didn't solve the problem.

Error with an ESLint rule, directly on Github

There is a problem with a rule and I cannot modify it because the node_modules files are being checked from somewhere else on Github. On my machine it's already solved in 2 different ways fine.
Please help with this. This should be inserted somewhere directly in the files or the code we download from this repo.

Screenshot from 2020-11-27 16-00-19(eslint error on Github)

Colorize gem not working in Pull Request with Github Actions checks

Description of issue

I followed the instruction correctly, I was able to setup the linter-config.

NOw I wanted to add Colorize in my project , I bundle installed the Colorize

which was present in my Gemfile as well as my germfile.lock as dependencies,
The repo is working fine in my Local system

But when I created the pull request, I am seeing the following error:

  RSpec Report
##[error]Process completed with exit code 1.
Run rspec --force-color --format documentation

An error occurred while loading ./spec/after_colon_spec.rb. - Did you mean?
                    rspec ./spec/spec_helper.rb

Failure/Error: require 'colorize'

LoadError:
  cannot load such file -- colorize
# ./lib/after_colon.rb:1:in `<top (required)>'
# ./spec/after_colon_spec.rb:2:in `require_relative'
# ./spec/after_colon_spec.rb:2:in `<top (required)>'

Finished in 0.00003 seconds (files took 0.16121 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

##[error]Process completed with exit code 1.

where I have added everything in proper channel and flow,
kindly find my pull request shubham14p3/Ruby-capstone-project#1

Note: I am having Stickler issue and Linter error as well, kindly ignore them, Kindly help me out with Test-Rspec, also when I tried to remove the Colorize, it worked for me, but I want to use Colorize. @santiago-rodrig

Possible solution

Add troubleshooting section here that explains issues like this with the possible solution

[JS] Linter rule about `.js` extensions make some code unusable

Problem

When I use the provided eslint rules in my project without nodejs/webpack this error shows on the browser:
FIREFOX
image
CHROME:
image

As microverse uses airbnb-base:

"extends": ["airbnb-base"],

...and this rules states that not showing extensions are enforced:

https://github.com/airbnb/javascript/blob/6d05dd898acfec3299cc2be8b6188be542824965/packages/eslint-config-airbnb-base/rules/imports.js#L139-L143

But browsers don't get files without extension, as showed on my screen and here:
https://stackoverflow.com/a/55289496/9948644

When I added extensions error disappeared from browser and code run normally.

This is important because in the first projects (and maybe test or vanillaJS code) we won't have Nodejs and ES support, and some juniors can be locked with this instead of business code.

Proposal

For the first 2 projects (when we don't use webpack) let us add to our copy of the microverse' JavaScript rules:

"rules": {
    "import/extensions": [
            "error",
            "ignorePackages",
            {
              "js": "always"
            }
    ]
}

On the remain projects use the rules as normal.

Unable to find Ruby version 3.0.0

I had an issue with .github/workflows/linters.yml for specifying an older version of Rubocop (0.8 if my memory doesn't fail me), which doesn't support Ruby 3.0.0

I just updated the Rubocop version to 1.11 in line 19 and it worked just fine.

:D

Automate reviews with GitHub Actions

Proposal to use GitHub Actions instead of Stickler.

Problem

When students submit their HTML&CSS projects, they have to wait a couple of hours to get feedback.

Often, the feedback includes validating the HTML file. For that, the TSEs need to validate the files and then provide feedback so students can go on and validate the files themselves to find and fix the issues and then request another code review.

That’s a long process that could be automated.

Stickler does not provide the ability to run HTML validation, and since it is a black box, there is small room for customization, for example, #56.

GitHub Actions

We can run the CSS linter using GitHub actions, with the advantage that GHA is not a black box so we can install dependencies and customize to our needs as much as we want. There is also no need to enable anything from the student making it easier to use, just copy the file and GitHub will pick it up and run it.

Here is a test PR which runs Stylelint and html-validator: https://github.com/MauricioRobayo/gh-actions-html-css/pull/3

We can do a lot with GitHub actions to automate many of code-reviews processes. For example, the Ruby OOP Milestone 1 is checking the project setup. So we can run a Bash script to validate the required setup: https://github.com/MauricioRobayo/mv-oop1-gh-actions/pull/4

The students will have immediate feedback once they open a PR:

image

In the end, a TSE should check the project and approve it or request changes, but most of the feedback will be already given making it a faster process for the student and a lighter one for the TSEs, so students will be able to move faster and TSEs will be able to cover more ground.

And on top of all, students can add cool badges to their READMEs 😄 :

Linters Linters

React Linters yml should be [email protected] rather than 2.20

on version 2.20 you get the following error

Error: .eslintrc » eslint-config-airbnb » //node_modules/eslint-config-airbnb-base/index.js » //node_modules/eslint-config-airbnb-base/rules/imports.js: Configuration for rule "import/no-cycle" is invalid: Value "∞" should be integer.

New cops warning

New cops by default will throw a Linter warning, that ask to enable or disable the new cops and it will make the code not pass in Stickler CI.

Following the documentation, use this configuration:
AllCops:
NewCops: disable

Will be the best approach, otherwise after any update we go thought this error again and again.

But this configuration, for some reason, is throwing this error:
Warning: AllCops does not support NewCops parameter.
In disagreement with documentation.

See more on https://docs.rubocop.org/en/latest/versioning/

Installing rspec to run on github actions is not working

Description

I added this rspec tests setup file to my .github/workflows/ folder to let github actions run my tests whenever I push new codes to my PR, but it is giving me this error:

Run [ -f Gemfile ] && bundle --deployment
/opt/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /home/runner/work/telegram-bot/telegram-bot/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.4`
	from /opt/hostedtoolcache/Ruby/2.6.6/x64/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
	from /opt/hostedtoolcache/Ruby/2.6.6/x64/bin/bundle:23:in `<main>'
##[error]Process completed with exit code 1.

I tried to research how to fix this but did not find any clue, maybe something is wrong!

LoadError: cannot load such file --

RSpec fails multiple times in CI due to this error.

An error occurred while loading ./spec/helpers/git_spec.rb. - Did you mean?
                    rspec ./spec/spec_helper.rb

Failure/Error: require 'git'

LoadError:
  cannot load such file -- git
# ./lib/helpers/git.rb:1:in `<top (required)>'
# ./spec/helpers/git_spec.rb:3:in `require_relative'
# ./spec/helpers/git_spec.rb:3:in `<top (required)>'

Finished in 0.00003 seconds (files took 0.12259 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

##[error]Process completed with exit code 1.

To resolve this error, run rspec inside the project context bundle exec rspec

issue with rubcop extension in visual studio code

am using an extenstion called ruby-rubocop with visual studio editor

but when trying to add the microverse linter for rails projects there is a notification appears contain the message

.rubocop.yml: Layout/LineLength has the wrong namespace - should be Metrics Warning: unrecognized cop Layout/HashAlignment found in .rubocop.yml

Stylelint Failling for rails Api-only applications

The Stylelint configs work as expected with a normal rails application, ie run the checks on any CSS/SCSS file however an API-only application does not have any of those files the result is that eslint failing the checks and returning the following

Error: No files matching the pattern "**/*.{css,scss}" were found. at /home/runner/work/final-capstone-api/rails-app/node_modules/stylelint/lib/standalone.js:211:12 at processTicksAndRejections (internal/process/task_queues.js:97:5) ##[error]Process completed with exit code 1.

Version for eslint-plugin-import may need to be updated to ^2.22.1

Using the npm install commands for ESLint in the react-redux module produced an error for me when I tried to run npx eslint .:

Configuration for rule "import/no-cycle" is invalid:
Value "∞" should be integer.

I fixed this issue by upgrading the version of eslint-plugin-import in my package.json, and it then worked fine. The version I updated to was

"eslint-plugin-import": "^2.22.1"

Perhaps the linter setup instructions should be modified to avoid this error in future?

Webhint Setup in Local Env not Working in OS X El Capitan

Hi,

I would appreciate help setting up Webhint in my local env. I've tried following the HTML-CSS Guide, but it doesn't work.

My setup description:

OS: El Capitan version 10.11.6
Code Editor: VS Code, Version: 1.49.1
Node version: v14.7.0
NPM version: 6.14.7
Node Version Manager: (v0.35.3)

Every time I run npx hint . I get something like this:
Screen Shot

or this:
Screen Shot 2020-09-22 at 3 29 47 PM

When running this npm install --save-dev [email protected] in the Terminal, as per the Guide for Linters setup microverseinc /
linters-config
, I get the following:
Screen Shot 2020-09-22 at 3 28 28 PM

I ran npm init in the local repo/directory. This created the node_modules/ directory and the following two files:

  • package-lock.json
  • package.json

This didn't make much of a difference. I have tried this in 2 different repos and still nothing.
I also tried this npm i hint to try installing the latest version of webhint, but still nothing. This is what I got after running it:
Screen Shot 2020-09-22 at 5 57 17 PM

I even tried installing npm globally on my root dir, by running this npm install -g --save-dev [email protected]. It didn't work either. I got this:
Screen Shot 2020-09-22 at 8 53 03 AM copy

Anybody else had this same issue? I wonder if it has something to do with my OS, as it's quite outdated (almost obsolete by now).

Hopefully, someone can show me how to fix this.

P.S.
I copied the .hintrc file to the root dir before running npx hint, and yes I ran npm init before the npm install --save-dev [email protected] command.

My current dependencies section in the package.json file looks like this:
Screen Shot 2020-09-22 at 6 05 27 PM

[JS] Eslint installation needs to state that `package.json` is needed

Problem

In my javascript project (a Template Repository, BTW):
image

I tried to run npx eslint . and I found the follow error:
image

After battle some minutes I found that its mandatory to have a package.json in the folder, which is not stated on the README explicitly.

This lack of information can mislead certain students, as for some of them maybe this is the first contact with nodejs, npm or npx.

Proposal

Modify the instructions in this section to add after these line:
image

Something like:

run npm --init , answer the questions to generate a package.json that store the info needed for NodeJS to start your project. You can modify this file later to fit your needs. Also create a .gitignore with node_modules inside.

Then the next step (npx eslint --init) must work normally.

"sampleVariable" is never reassigned. Use 'const' instead prefer-const

I am creating a variable with "let" and creating an element assigning in it to this variable like so:

  let tasksArray;
  tasksArray = setTasksArray(tasksArray, key);

  tasksArray.map((newTask) => {
    // Some code //
}

The problem is tasksArray will be defined based on passed arguments.
If const is used, it can't define value dynamically.

CLI for running https://validator.w3.org/

Might be good to include on the README.md for the HTML/CSS module that there is a CLI for running the w3 validator, so we don't have to copy/paste the HTML files on the page to get the validation: html-validator-cli, which is using the w3 validator API.

The fewer steps are between a tool and the user the more probable she/he is going to use it. So having that option might be a good improvement in the development workflow and toolbox.

If this seems to be a good idea, I'll be glad to update the README.md to include the info with installation instructions and make the PR.

selector-type-case error on a .js file

selector-type-case error on a .js file

  • I get this Stylelint error when I use a .js file for material-ui.

Screen Shot 2021-03-31 at 11 53 25

  • However, if I omit styles on @material-ui/core/styles as shown on the screenshot below, I don't get the Stylelint errors.

Screen Shot 2021-03-31 at 14 09 47

Parsing error: Unexpected token = eslint because of the airbnb style configuration in React-Redux project

Since Microverse linting style is base on Airbnb this raises some times unexpected token errors due to incompatibility between the local development environment and ESLint in few specific cases.

I've been affected for this issue when trying to declare an event handler function inside a class component, the linter points to a no existent error and the only available solution that I could spot so far is to add some configuration in the .eslintrc file, like:

"parser": "babel-eslint"

This is the non existent error:
Screenshot_20200714_143553

What it could be a possible solution since I'm not allowed to perform any changes in the linting configurations files and there's no other way to pass all the test?

Rubocop 0.88 error in .yml in local env

When I run rubocop without the .yml file it shows the usual behavior (tells me to correct lines in my code).

However, when I try to run it with the .yml, I get this error:

(/home/puma/projects/cvviewer/.rubocop.yml): mapping values are not allowed in this context at line 123 column 73
/home/puma/.gem/ruby/2.7.0/gems/psych-3.2.0/lib/psych.rb:454:in parse' /home/puma/.gem/ruby/2.7.0/gems/psych-3.2.0/lib/psych.rb:454:in parse_stream'
/home/puma/.gem/ruby/2.7.0/gems/psych-3.2.0/lib/psych.rb:388:in parse' /home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/lib/rubocop/yaml_duplication_checker.rb:11:in check'
/home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/lib/rubocop/config_loader.rb:205:in check_duplication' /home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/lib/rubocop/config_loader.rb:61:in load_yaml_configuration'
/home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/lib/rubocop/config_loader.rb:40:in load_file' /home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/lib/rubocop/config_loader.rb:103:in configuration_from_file'
/home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/lib/rubocop/config_store.rb:58:in for_dir' /home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/lib/rubocop/config_store.rb:37:in for_pwd'
/home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/lib/rubocop/cli.rb:124:in apply_default_formatter' /home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/lib/rubocop/cli.rb:40:in run'
/home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/exe/rubocop:13:in block in <top (required)>' /usr/lib/ruby/2.7.0/benchmark.rb:308:in realtime'
/home/puma/.gem/ruby/2.7.0/gems/rubocop-0.88.0/exe/rubocop:12:in <top (required)>' /home/puma/.gem/ruby/2.7.0/bin/rubocop:23:in load'
/home/puma/.gem/ruby/2.7.0/bin/rubocop:23:in `

'

I recently had to change my hard drive (thus reinstalling all the OS and stuff) and I noticed that now I'm running version 0.88 instead of 0.80, not sure if it's relevant. (or maybe I'm doing something wrong)

Anyway, I appreciate if you can help with this.

Why ignore /bin/ directory for Ruby project?

With reference to this block of code:

files:
ignore:
- "bin/*"
- "db/*"
- "config/*"
- "Guardfile"
- "Rakefile"

source

AllCops:
Exclude:
- "bin/*"
- "db/**/*"
- "config/**/*"
- "Guardfile"
- "Rakefile"

source

The bin directory contains codes that should be lint. For example, in the Tic Tac Toe project, we put our main.rb in that folder. So ignoring that directory means we could write dirty codes and get away with it.

I suggest we not ignore the /bin/. directory for the Ruby section.

Update check-linters-config script with new configs

Update check-linters-config script with new configs

Description of issue

Great tool but seems like it's not updated for the todays linter requirements.

check-linters-config looks for ".stickel.yml" but is not needed anymore for the whole curriculum. It should look for .stylelinterrc.json, .hintrc, .rubocop.yml , .eslintrc.json instead.

Proposed solution

case $1 in
  html-css)
-  config_files=(".stickler.yml" "stylelint.config.js")
+  config_files=(".hintrc" ".stylelintrc.json")
  ;;
-  ruby | ror)
+  ruby)
-  config_files=(".stickler.yml" ".rubocop.yml")
+  config_files=(".rubocop.yml")
  ;;
+  ror)
+  config_files=(".stylelintrc.json" ".rubocop.yml")
+  ;;
  javascript | react-redux)
-  config_files=(".stickler.yml" ".eslintrc.json")
+  config_files=(".stylelintrc.json" ".eslintrc.json")
  ;;
  *)
  echo "$usage"
  exit 1
esac

Error with Rubocop on branch.

Run rubocop --color
rubocop --color
shell: /bin/bash -e {0}
env:
FORCE_COLOR: 1
Error: RuboCop found unknown Ruby version 3.0 in /home/runner/work/The_BookShelve/The_BookShelve/Gemfile.lock.
Supported versions: 2.3, 2.4, 2.5, 2.6, 2.7
Error: Process completed with exit code 2.

The JavaScript eslint configuration has unnecesary steps

Going through eslint questions takes time...

If you are going to overwrite the generated .eslintrc.json file then stepping through npx eslint --init is unnecessary, I suggest doing the following:

  1. npm i --save-dev eslint eslint-config-airbnb-base eslint-plugin-import
  2. downloading the file .eslintrc.json

If you think it's better the actual way of doing it then that's fine, but at least let me know why.

Thanks for your time.

ESLint "arrow-parens" should be disabled

we have the arrow-parens as an error in the ESLint config, which gives an error for wrapping single params functions' params in parentheses

here's an example:

// error 

const myFunc = ( data ) => {

  // some code

}

// no error 

const myFunc = data => {

  // some code

}

I don't see the reason why?
there's no performance benefit as far as I know, and it's actually not liked by most developers for the fact that if you gonna add another param to the function, you gonna have to do extra steps to wrap the current param in parentheses then add space on the sides then add the new argument

here's a related discussion where they talk about why this is bad prettier/prettier#812

please let me know if there was a reason for this to be enabled, if there isn't any, then this rule should be disabled.

Rubocop producing warning about new unconfigured cops

Using the .rubocop.yml and .github/workflows/linters.yml files from this linters-config/ror repository produces this warning for me in the terminal when running rubocop. It also means that there are a number of offences that are not picked up until the GitHub Actions CI, which is apparently running cops that are not present when I'm linting locally. Am I doing something wrong or do these config files need updating?

The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file.

Please also note that can also opt-in to new cops by default by adding this to your config:
  AllCops:
    NewCops: enable

Layout/SpaceBeforeBrackets: # (new in 1.7)
  Enabled: true
Lint/AmbiguousAssignment: # (new in 1.7)
  Enabled: true
Lint/DeprecatedConstants: # (new in 1.8)
  Enabled: true
Lint/DuplicateBranch: # (new in 1.3)
  Enabled: true
Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
  Enabled: true
Lint/EmptyBlock: # (new in 1.1)
  Enabled: true
Lint/EmptyClass: # (new in 1.3)
  Enabled: true
Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
  Enabled: true
Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
  Enabled: true
Lint/NumberedParameterAssignment: # (new in 1.9)
  Enabled: true
Lint/OrAssignmentToConstant: # (new in 1.9)
  Enabled: true
Lint/RedundantDirGlobSort: # (new in 1.8)
  Enabled: true
Lint/SymbolConversion: # (new in 1.9)
  Enabled: true
Lint/ToEnumArguments: # (new in 1.1)
  Enabled: true
Lint/TripleQuotes: # (new in 1.9)
  Enabled: true
Lint/UnexpectedBlockArity: # (new in 1.5)
  Enabled: true
Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
  Enabled: true
Style/ArgumentsForwarding: # (new in 1.1)
  Enabled: true
Style/CollectionCompact: # (new in 1.2)
  Enabled: true
Style/DocumentDynamicEvalDefinition: # (new in 1.1)
  Enabled: true
Style/EndlessMethod: # (new in 1.8)
  Enabled: true
Style/HashExcept: # (new in 1.7)
  Enabled: true
Style/IfWithBooleanLiteralBranches: # (new in 1.9)
  Enabled: true
Style/NegatedIfElseCondition: # (new in 1.2)
  Enabled: true
Style/NilLambda: # (new in 1.3)
  Enabled: true
Style/RedundantArgument: # (new in 1.4)
  Enabled: true
Style/SwapValues: # (new in 1.1)
  Enabled: true
For more information: https://docs.rubocop.org/rubocop/versioning.html

Update Ruby version 3.0.0

Hello, currently we have Ruby version 3.0.0 but this linters do not support the latest version.
Kindly update it to make it easier for configuration with the latest Ruby version.
Thanks.

Use Ruby Linters Configuration for ROR API-only Projects

  • When building a Ruby on Rails API-only projects, files in the asset folder including CSS don't form part of the project. For this reason, your code would never pass the stylelint checks using the ROR linter configuration. I, therefore, suggest that the Ruby linter configuration should be used for ROR API-only projects.

Unable to resolve path to module .." (import/no-unresolved)

I'm getting this linter error while using import '@fortawesome/fontawesome-free/js....
After doing some research on it, many solutions solved it by adding "import/no-unresolved": "off" to the .eslintrc file.
May you have a look at it because I'm stuck with my project.
If it is okay I can create PR for it.

Thanks

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.