Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# Project specific config
os:
- linux
- osx

env:
matrix:
- ATOM_CHANNEL=stable
- ATOM_CHANNEL=beta

# Installed for linting the project
language: node_js
node_js: "6"

matrix:
include:
- os: linux
env: ATOM_CHANNEL=stable
node_js: "6"

- os: linux
env: ATOM_CHANNEL=beta
node_js: "6"

- os: osx
env: ATOM_CHANNEL=stable
node_js: "6"

# Generic setup follows
script: 'curl -Ls https://github.com/Arcanemagus/ci/raw/atomlinter/build-package.sh | sh'
Expand Down
22 changes: 12 additions & 10 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
'use babel';

const GRAMMAR_SCOPES = [
'text.html.angular',
'text.html.basic',
'text.html.erb',
'text.html.gohtml',
'text.html.jsp',
'text.html.mustache',
'text.html.ruby'
];
import { CompositeDisposable } from 'atom';

const grammarScopes = [];

export function activate() {
require('atom-package-deps').install('linter-htmlhint');

const subscriptions = new CompositeDisposable();
subscriptions.add(atom.config.observe('linter-htmlhint.enabledScopes', scopes => {
// Remove any old scopes
grammarScopes.splice(0, grammarScopes.length);
// Add the current scopes
Array.prototype.push.apply(grammarScopes, scopes);
}));
}

function getConfig(filePath) {
Expand All @@ -38,7 +40,7 @@ function getConfig(filePath) {
export function provideLinter() {
return {
name: 'htmlhint',
grammarScopes: GRAMMAR_SCOPES,
grammarScopes,
scope: 'file',
lintOnFly: true,
lint: editor => {
Expand Down
29 changes: 24 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,25 @@
"url": "https://github.com/AtomLinter/linter-htmlhint.git"
},
"engines": {
"atom": ">=1.0.0 <2.0.0"
"atom": ">=1.4.0 <2.0.0"
},
"configSchema": {
"enabledScopes": {
"description": "List of scopes to run HTMLHint on, run `Editor: Log Cursor Scope` to determine the scopes for a file.",
"type": "array",
"default": [
"text.html.angular",
"text.html.basic",
"text.html.erb",
"text.html.gohtml",
"text.html.jsp",
"text.html.mustache",
"text.html.ruby"
],
"items": {
"type": "string"
}
}
},
"scripts": {
"test": "apm test",
Expand Down Expand Up @@ -40,18 +58,19 @@
"eslintConfig": {
"rules": {
"comma-dangle": [
2,
"error",
"never"
],
"global-require": 0,
"global-require": "off",
"import/no-unresolved": [
2,
"error",
{
"ignore": [
"atom"
]
}
]
],
"import/no-extraneous-dependencies": "off"
},
"extends": "airbnb-base",
"globals": {
Expand Down