refactor(internal): Use named function expressions

This commit is contained in:
Dominik Ferber
2015-10-29 17:37:28 +01:00
parent be73ffa031
commit d191e97b6b
8 changed files with 8 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
export default function (property) {
export default function getPropertyName (property) {
if (property.type === 'Literal') {
return property.value
} else if (property.type === 'Identifier') {

View File

@@ -1,4 +1,4 @@
export default function (type) {
export default function isFunction (type) {
return (
type === 'ArrowFunctionExpression' ||
type === 'FunctionExpression'

View File

@@ -1,6 +1,6 @@
import isMeteorProp from './isMeteorProp'
export default function (node, propName) {
export default function isMeteorCall (node, propName) {
return (
node.type === 'CallExpression' &&
node.callee.type === 'MemberExpression' &&

View File

@@ -1,4 +1,4 @@
export default function (node, propName) {
export default function isMeteorProp (node, propName) {
return (
node.type === 'MemberExpression' &&
node.object.type === 'Identifier' && node.object.name === 'Meteor' &&

View File

@@ -1,6 +1,6 @@
import getPropertyName from './getPropertyName'
export default function (node, propName) {
export default function isTemplateProp (node, propName) {
return (
node.type === 'MemberExpression' &&
node.object.type === 'MemberExpression' &&

View File

@@ -2,7 +2,7 @@ import {UNIVERSAL, CLIENT, SERVER} from '../environment'
const meteorEnvRegEx = /^eslint-meteor-env (client|server)\s?(,\s?(client|server))*$/
export default function (comments = []) {
export default function getEnvFromComments (comments = []) {
const envs = new Set()
comments.forEach(comment => {
const trimmedValue = comment

View File

@@ -1,7 +1,7 @@
import stripPathPrefix from './stripPathPrefix'
const getRootPath = require('./getRootPath')
export default function (filename) {
export default function getRelativePath (filename) {
// '<input>' is ESLint's default filename when the real one is not known
if (filename === '<input>') {
return false

View File

@@ -9,7 +9,7 @@ function hasFile (parent, filename) {
// cache for root paths
const rootPaths = []
export default function (filename) {
export default function getRootPath (filename) {
// check whether the project root is already known or not
let rootPath = find(rootPaths, function (currentPath) {