广西快乐双彩不开奖啊:Stylelint + TextMate integration

October 1st, 2017. Tagged: CSS, tools

Naturally, you want your lint tools integrated with your text editor. Here's what I did to integrate Stylelint (hello!) with TextMate.

New Bundle

In TextMate... menu Bundles / Edit Bundles.... I didn't see a way to add a new Command, so I right-clicked an existing one (one with a C icon for Command), selected Find in Finder and just duplicated it. This way it appears in the bundle editor and you can tweak.

PATH is in order

You need to have the path to node and to stylelint (likely the same) in your TextMate path preferences (menu TextMate / Preferences / Variables / PATH). To tell where node is, type `which node`.

Global config

Stylelint needs a config. See last post on how to setup a global one.

Setting up the new command

Here's a screenshot of my setup:

textmate + stylelint bundle setup

Basically run Stylelint when pressing CMD+L. Show the results in a tooltip.

And some magic to find the first error to move the cursor there:

#!/usr/bin/env ruby18
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'

error = `stylelint "$TM_FILEPATH"`

if error.empty?
  puts 'No lint errors'
else
  puts error
  TextMate.go_to :line => $1, :column => $2 if error =~ / (\d+):(\d+)/
end

In action

And here is the whole integration in action. The lint finds an error and helpfully moves the cursor there.

textmate + stylelint in action

Tell your friends about this post: Facebook, Twitter, Google+

Sorry, comments disabled and hidden due to excessive spam. Working on restoring the existing comments...

Meanwhile, hit me up on twitter @stoyanstefanov


  • “四新”彰显党的十九大思想灵魂和精髓要义 2018-08-17
  • 热身赛-U17女篮73-68立陶宛 杨舒宇19分刘禹彤13分 2018-08-16
  • 七月流火:一半是甜蜜 一半是仁慈 2018-08-15
  • “嫦娥”飞向月球背面,将会揭开哪些秘密? 2018-08-15
  • 一代枭雄身后事:“曹操墓”认定过程缘何一波三折? 2018-08-04
  • 女出纳侵吞千万公款扮富婆 7年未被公司发现 2018-08-04
  • 南昌PM2.5浓度写进目标责任书 切实防治大气污染 2018-07-20
  • 网友投诉不文明养犬行为 有关部门加强治理 2018-07-20
  • 1000| 776| 207| 184| 272| 602| 359| 777| 709| 5|