Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

.eslintignore 怎么过滤多层级文件夹?

旧项目想针对新建的文件进行eslint校验,旧代码不做校验检测。
比如我的项目目录是这样的

   -- src
     -- api
     -- assets
     -- compnonents
     -- pages
        -- home
            -- index.vue
            -- index.js
        -- about
            -- index.vue 
            -- index.js
        ***
     -- utils
    ***

我现在想在pages文件下新增一个 detail 模块,我怎么做到eslint只校验 detail模块的内容.

下面这种方式不起作用

src/**/*
!src/pages/detail/

这种方式又只能处理pages层级下的内容

src/pages/*
!src/pages/detail/

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

实验了一下貌似只能这么处理了。。。

src/api/*
src/assets/*
src/components/*
src/pages/*

!src/pages/detail/

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...