Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 98e5289

Browse files
committed
Move to imports
Move to the `import` syntax for bringing in the dependencies. Note that since Atom calls the service provider function on package activation this doesn't make a big difference on performance.
1 parent 4311569 commit 98e5289

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
'use babel';
22

3+
import * as helpers from 'atom-linter';
4+
import { extname } from 'path';
5+
36
export default {
47
activate: () => {
58
require('atom-package-deps').install('linter-ruby');
69
},
710

811
provideLinter: () => {
9-
const helpers = require('atom-linter');
10-
const Path = require('path');
1112
const regex = /.+:(\d+):\s*(.+?)[,:]\s(.+)/;
1213
return {
1314
name: 'Ruby',
@@ -18,7 +19,7 @@ export default {
1819
const command = atom.config.get('linter-ruby.rubyExecutablePath');
1920
const ignored = atom.config.get('linter-ruby.ignoredExtensions');
2021
const filePath = activeEditor.getPath();
21-
const fileExtension = Path.extname(filePath).substr(1);
22+
const fileExtension = extname(filePath).substr(1);
2223

2324
if (ignored.includes(fileExtension)) {
2425
return [];

0 commit comments

Comments
 (0)