Code Monkey home page Code Monkey logo

Comments (5)

xcatliu avatar xcatliu commented on May 17, 2024

没有 href 属性的 a 标签,与有 href 属性的 a 标签样式上会有差别,加上 javascript:void(0) 可以解决这个问题。

from eslint-config-alloy.

mengjian-github avatar mengjian-github commented on May 17, 2024

那个是写在html里,不在检验范围内,而且有href也可以直接prevent default ,不要采用javascript伪协议,感觉是美工时代的写法了

from eslint-config-alloy.

xcatliu avatar xcatliu commented on May 17, 2024

这个规则是用于限制使用 javascript 来设置 href 属性的,与在 html 里面设置 href 是一样的效果呀

from eslint-config-alloy.

mengjian-github avatar mengjian-github commented on May 17, 2024

@xcatliu 对啊,不能因为javascript:void(0)一个特例就把整个放开啊,就像有人只用eval来处理json,就把eval放开吗,既然有更好的替代方案为什么还要纠结于一种不好的写法呢?不使用javascript:这种不安全的伪协议应该达成共识吧。

from eslint-config-alloy.

xcatliu avatar xcatliu commented on May 17, 2024

嗯有道理,决定开启此规则。

from eslint-config-alloy.

Related Issues (20)

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.